LinqConnect WCF DataService

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
davgut
Posts: 1
Joined: Mon 24 Apr 2017 08:40

LinqConnect WCF DataService

Post by davgut » Wed 10 May 2017 07:34

Hi,
I am trying to setup a WCF Data Services solution to be able to serve remote clients data from the generated "datacontext". Do you any samples or guides to help me with this setup?

I have setup a service with the following code:
public class WcfDataService1 : DataService<DigRAD.v46.Win.Core.DrbLinqSql.DrbDataContext>
{
// This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
{
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
// Examples:
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
// config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
}
}

When I try to browse the service I get the following exception:
On data context type 'DrbDataContext', there is a top IQueryable property 'AcntClientMasters' whose element type is not an entity type. Make sure that the IQueryable property is of entity type or specify the IgnoreProperties attribute on the data context type to ignore this property.

Best regards
David Gutefeldt

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: LinqConnect WCF DataService

Post by Shalex » Wed 10 May 2017 15:38

WCF Data Services requires each entity to have a key defined: http://stackoverflow.com/questions/6180 ... inq-to-sql.

JIC:
Entity Developer allows to set custom attributes:
a) navigate to Model > Settings > Attributes > select the assembly with the needed attributes and make sure that the needed attributes are checked in the window below, press OK
b) select the needed attribute in the Attributes collection of a particular class property

Post Reply