Poco, generic repository and mapping of CLR type to EDM type error

I am using a CTP4 and generic repository pattern as posted by Huy Nguyen
http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/

I have pocos I am mapping to a legacy database (no edmx) and trying to host them as a wcf data service.  The repository works fine outside of the data service, but when I try to host as a data service I can navigate to the service, but get the error
below when trying to access an entity in the service.

I have no other types in the project that it is complaining are duplicates beyond the poco entities.

I’ve done some searching on this error but nothing seems to apply. Anyone have tips on what sorts of things I should be looking for to fix?

System.Data.MetadataException was unhandled by user code

  Message=Schema specified is not valid. Errors:

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type ‘Item’. Previously found CLR type ‘Company.Server.Data.Model.Item’, newly found CLR type ‘Company.Server.Data.Model.Item’.

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type ‘Customer’. Previously found CLR type ‘Company.Server.Data.Model.Customer’, newly found CLR type ‘Company.Server.Data.Model.Customer’.

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type ‘Order’. Previously found CLR type ‘Company.Server.Data.Model.Order’, newly found CLR type ‘Company.Server.Data.Model.Order’.

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type ‘OrderDetail’. Previously found CLR type ‘Company.Server.Data.Model.OrderDetail’, newly found CLR type ‘Company.Server.Data.Model.OrderDetail’.

  Source=System.Data.Entity

  StackTrace:

       at System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage)

       at System.Data.Metadata.Edm.ObjectItemCollection.ImplicitLoadAssemblyForType(Type type, EdmItemCollection edmItemCollection)

       at System.Data.Metadata.Edm.MetadataWorkspace.ImplicitLoadAssemblyForType(Type type, Assembly callingAssembly)

       at System.Data.Objects.ObjectContext.CreateQuery[T](String queryString, ObjectParameter[] parameters)

       at Company.Common.Data.Infrastructure.Repository.GenericRepository.GetQuery[TEntity]() in C:devDemoCompany.Common.Data.InfrastructureRepositoryGenericRepository.cs:line 58

       at Company.Server.Data.OmnicenterRepository.get_Items() in C:devDemoCompany.Server.DataOmnicenterRepository.cs:line 45

       at queryable_reader(Object )

       at System.Data.Services.Providers.ReflectionServiceProvider.GetResourceContainerInstance(ResourceSet resourceContainer)

       at System.Data.Services.Providers.BaseServiceProvider.GetQueryRootForResourceSet(ResourceSet container)

       at System.Data.Services.Providers.DataServiceProviderWrapper.GetQueryRootForResourceSet(ResourceSetWrapper resourceSet)

       at System.Data.Services.RequestUriProcessor.CreateFirstSegment(IDataService service, String identifier, Boolean checkRights, String queryPortion, Boolean isLastSegment, Boolean& crossReferencingUrl)

       at System.Data.Services.RequestUriProcessor.CreateSegments(String[] segments, IDataService service)

       at System.Data.Services.RequestUriProcessor.ProcessRequestUri(Uri absoluteRequestUri, IDataService service)

       at System.Data.Services.DataService`1.ProcessIncomingRequestUri()

       at System.Data.Services.DataService`1.HandleRequest()

  InnerException:

 

 

 

Hi,Would you be able to send me a solution that reproduces this issue so I can work out what is going wrong? rowmil AT microsoft DOT com~Rowan