Exemple #1
0
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
     config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
     config.DataServiceBehavior.AcceptCountRequests = true;
     config.DataServiceBehavior.AcceptProjectionRequests = true;
     config.UseVerboseErrors = true;
 }
Exemple #2
0
 // 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.
     config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
     config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
     config.DataServiceBehavior.AcceptCountRequests = true;
     config.DataServiceBehavior.AcceptProjectionRequests = true;
     config.UseVerboseErrors = true;
 }
        public static new void InitializeService(DataServiceConfiguration config)
        {
            config.UseVerboseErrors = true;
            config.SetEntitySetAccessRule("Review", EntitySetRights.All);
            config.SetEntitySetAccessRule("ReviewComment", EntitySetRights.All);
            config.SetEntitySetAccessRule("ReviewFieldValue", EntitySetRights.All);
            config.SetEntitySetAccessRule("UserBlackList", EntitySetRights.All);
            config.SetEntitySetAccessRule("ReviewSchema", EntitySetRights.All);
            config.SetEntitySetAccessRule("Subscription", EntitySetRights.All);
            config.SetEntitySetAccessRule("ReviewFieldSchema", EntitySetRights.All);

            //This could be "*" and could also be ReadSingle, etc, etc.
            config.SetServiceOperationAccessRule("GetTopReviews", ServiceOperationRights.AllRead);
			
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        }
        // This method is called just once to initialize global service policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("*", EntitySetRights.All);
            config.DataServiceBehavior.AcceptAnyAllRequests = true;
            config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
            config.SetServiceActionAccessRule("*", ServiceActionRights.Invoke);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
            config.DataServiceBehavior.AcceptProjectionRequests = true;
            config.DataServiceBehavior.AcceptCountRequests = true;
            config.AnnotationsBuilder = CreateAnnotationsBuilder(() => serviceContext);
            config.DataServiceBehavior.AcceptReplaceFunctionInQuery = true;
            config.DataServiceBehavior.AcceptSpatialLiteralsInQuery = true;
            config.DisableValidationOnMetadataWrite = true;
#if DEBUG
            config.UseVerboseErrors = true;
#endif
        }