Esempio n. 1
0
        /// <summary>
        /// Initializes the <see cref="MarketDataService"/> for use
        /// </summary>
        /// <param name="config"></param>
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;

            config.SetEntitySetAccessRule("Subscriptions", EntitySetRights.All);
            config.SetEntitySetAccessRule("DataProviders", EntitySetRights.All);
            config.SetEntitySetAccessRule("StockListProviders", EntitySetRights.All);

            config.RegisterKnownType(typeof(SubscriptionQuoteSummary));
            config.SetServiceOperationAccessRule("GetQuoteSummaries", ServiceOperationRights.AllRead);
        }
Esempio n. 2
0
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.UseVerboseErrors = true;
            config.DataServiceBehavior.AcceptSpatialLiteralsInQuery = false;
            config.DataServiceBehavior.MaxProtocolVersion           = Microsoft.OData.Client.ODataProtocolVersion.V4;
            config.SetEntitySetAccessRule("*", Microsoft.OData.Service.EntitySetRights.All);
            config.SetServiceActionAccessRule("*", Microsoft.OData.Service.ServiceActionRights.Invoke);
            config.SetServiceOperationAccessRule("*", Microsoft.OData.Service.ServiceOperationRights.All);

            config.SetEntitySetPageSize("Customer", 2);
            config.SetEntitySetPageSize("Order", 2);

            config.RegisterKnownType(typeof(ComplexWithAllPrimitiveTypes));
            config.EnableTypeAccess("*");
        }
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.UseVerboseErrors = true;
            config.DataServiceBehavior.AcceptSpatialLiteralsInQuery = false;
            config.DataServiceBehavior.MaxProtocolVersion           = System.Data.Services.Common.DataServiceProtocolVersion.V3;
            config.SetEntitySetAccessRule("*", System.Data.Services.EntitySetRights.All);
            config.SetEntitySetAccessRule("MappedEntityType", EntitySetRights.None);
            config.SetEntitySetAccessRule("Message", EntitySetRights.AllRead);

            config.SetServiceActionAccessRule("*", System.Data.Services.ServiceActionRights.Invoke);
            config.SetServiceOperationAccessRule("*", System.Data.Services.ServiceOperationRights.All);

            config.SetEntitySetPageSize("Customer", 2);
            config.SetEntitySetPageSize("Order", 2);

            config.RegisterKnownType(typeof(ComplexWithAllPrimitiveTypes));
            config.EnableTypeAccess("*");
        }