Пример #1
0
        public object GetService(Type serviceType)
        {
            if (SimpleDataServiceHelper.GetServiceCustomizer != null)
            {
                return(SimpleDataServiceHelper.GetServiceCustomizer(serviceType));
            }

            return(null);
        }
Пример #2
0
 protected override T CreateDataSource()
 {
     if (SimpleDataServiceHelper <T> .CreateDataSourceCustomizer != null)
     {
         return(SimpleDataServiceHelper <T> .CreateDataSourceCustomizer());
     }
     else
     {
         return((T)Activator.CreateInstance(typeof(T), CachedConnections.GetConnectionForType(typeof(T))));
     }
 }
Пример #3
0
        public static void InitializeService(DataServiceConfiguration configuration)
        {
            configuration.SetEntitySetAccessRule("*", EntitySetRights.All);
            configuration.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
            configuration.SetServiceActionAccessRule("*", ServiceActionRights.Invoke);

            configuration.UseVerboseErrors = true;

            if (SimpleDataServiceHelper.PageSizeCustomizer != null)
            {
                SimpleDataServiceHelper.PageSizeCustomizer(configuration as DataServiceConfiguration);
            }

            configuration.DataServiceBehavior.MaxProtocolVersion = MaxProtocolVersion;
        }