WCF odata - Resource type names must be unique. RRS feed

  • Question

  • Hi,

    I have a custom linq2sql generator using a bastardized version of this: http://l2st4.codeplex.com/ which seperates the table/function classes into seperate folders and namespaces based on the owninig schema in the database. So I end up with declarations similar to this in my datacontext class..

    public Table<Club.Clubs> Club_Clubs....


    public Table<My.Clubs> My_Clubs....

    I'm also following this..http://msdn.microsoft.com/en-us/library/ee373841.aspx to expose the linq2sql as odata...

    I'm getting this error from the Provider..

    More than one resource type with the name 'Clubs' was found. Resource type names must be unique.

    System.Data.Services.Providers.DataServiceProviderWrapper.AddUniqueNameToSet(String name, HashSet`1 names, String exceptionString)
    System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)

    It's pretty obvious why, but am I deluding myself thinking that it will be fairly easy to fix with a custom Metadata/Query provider by providing a fully qualified typename as opposed to the just the class name in the custom provider?



    Monday, February 20, 2012 4:59 PM


All replies

  • Hi,

    This is a known bug in fact. It will be fixed in the upcoming V3 release. You can try it with the latest CTP: http://blogs.msdn.com/b/astoriateam/archive/2011/10/13/announcing-wcf-data-services-oct-2011-ctp-for-net-4-and-silverlight-4.aspx

    I actually don't think that using custom provider would fix this, since the built-in reflection provider does correctly specify the namespace already, it's just that the duplicate detection logic didn't use the namespace. (But I didn't try it, so maybe it would work with the custom provider even on the V2 bits).


    Vitek Karas [MSFT]

    • Marked as answer by dogzb0110x Monday, February 20, 2012 8:43 PM
    Monday, February 20, 2012 8:10 PM
  • Hi Vitek, thanks very much for your answer...I don't fancy writing custom providers..

    I will be downloading the ctp. Glad to know I am not going mad....



    Monday, February 20, 2012 8:43 PM