LinqConnect WCF DataService
Posted: 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
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