locked
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....

    and

    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.Data.Services.Providers.DataServiceProviderWrapper.&lt;get_Types&gt;d__9.MoveNext()
    System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
    System.Data.Services.Providers.DataServiceProviderWrapper.PopulateMetadataCacheItemForV1Provider()
    System.Data.Services.DataService`1.CreateProvider()

    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?

    Thanks,

    Oli

    Monday, February 20, 2012 4:59 PM

Answers

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).

    Thanks,


    Vitek Karas [MSFT]

    • Marked as answer by dogzb0110x Monday, February 20, 2012 8:43 PM
    Monday, February 20, 2012 8:10 PM
    Moderator
  • 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....

    Regards,

    O

    Monday, February 20, 2012 8:43 PM