Example #1
0
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.SetEntitySetAccessRule("Albums", EntitySetRights.All);
     config.SetEntitySetAccessRule("Artists", EntitySetRights.AllRead);
     config.SetEntitySetAccessRule("Genres", EntitySetRights.AllRead);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
 }
Example #2
0
 // This method is called only once to initialize service-wide policies.
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.SetEntitySetAccessRule("Products", EntitySetRights.AllRead);
     config.SetEntitySetAccessRule("ProductPhotoes", EntitySetRights.AllRead);
     config.SetEntitySetAccessRule("ProductProductPhotoes", EntitySetRights.AllRead);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
 }
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.SetEntitySetAccessRule("Menus", EntitySetRights.All);
     config.SetEntitySetAccessRule("Categories", EntitySetRights.All);
     // NOTE: Если нужно ограничить кол-во возвращаемых записей: config.MaxResultsPerCollection = 100;
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
 }
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("Menus", EntitySetRights.All);
            config.SetEntitySetAccessRule("Categories", EntitySetRights.All);

            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
Example #5
0
        //<snippetDataServiceConfigComplete>
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            //<snippetDataServiceConfig>
            // Set the access rules of feeds exposed by the data service, which is
            // based on the requirements of client applications.
            config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Employees", EntitySetRights.ReadSingle);
            config.SetEntitySetAccessRule("Orders", EntitySetRights.All
                                          | EntitySetRights.WriteAppend
                                          | EntitySetRights.WriteMerge);
            config.SetEntitySetAccessRule("Order_Details", EntitySetRights.All);
            config.SetEntitySetAccessRule("Products", EntitySetRights.All);
            //</snippetDataServiceConfig>

            //<snippetDataServiceConfigPaging>
            // Set page size defaults for the data service.
            config.SetEntitySetPageSize("Orders", 20);
            config.SetEntitySetPageSize("Order_Details", 50);
            config.SetEntitySetPageSize("Products", 50);

            // Paging requires v2 of the OData protocol.
            config.DataServiceBehavior.MaxProtocolVersion =
                System.Data.Services.Common.DataServiceProtocolVersion.V2;
            //</snippetDataServiceConfigPaging>
        }
Example #6
0
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
     config.SetEntitySetAccessRule("*", EntitySetRights.All);
     config.SetEntitySetPageSize("*", 1000);
     config.SetEntitySetAccessRule("DeletedItems", EntitySetRights.AllRead);
 }
Example #7
0
 // This method is called only once to initialize service-wide policies.
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.SetEntitySetAccessRule("Events", EntitySetRights.AllRead);
     config.SetEntitySetAccessRule("Attendees", EntitySetRights.All);
     config.SetServiceOperationAccessRule("AddAttendee", ServiceOperationRights.All);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
 }
Example #8
0
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("Employees", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Customers", EntitySetRights.All);
            config.SetEntitySetAccessRule("Orders", EntitySetRights.All);
            config.SetEntitySetAccessRule("Order_Details", EntitySetRights.All);
            config.SetEntitySetAccessRule("Products", EntitySetRights.All);
            config.UseVerboseErrors = true;
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;

            //<snippetServiceOperationConfig>
            config.SetServiceOperationAccessRule(
                "GetOrdersByCity", ServiceOperationRights.AllRead);
            //</snippetServiceOperationConfig>

            config.SetServiceOperationAccessRule("RaiseError", ServiceOperationRights.AllRead);
            config.SetServiceOperationAccessRule("GetNewestOrder", ServiceOperationRights.AllRead);
            config.SetServiceOperationAccessRule("CountOpenOrders", ServiceOperationRights.AllRead);
            config.SetServiceOperationAccessRule("ReturnsNoData", ServiceOperationRights.AllRead);
            config.SetServiceOperationAccessRule("GetCustomerNames", ServiceOperationRights.AllRead);
            config.SetServiceOperationAccessRule("GetCustomerNamesPost", ServiceOperationRights.AllRead);
            config.SetServiceOperationAccessRule("CloneCustomer", ServiceOperationRights.AllRead);
            config.SetServiceOperationAccessRule("GetOrdersByState", ServiceOperationRights.AllRead);
            config.SetEntitySetPageSize("Customers", 10);
            config.SetEntitySetPageSize("Orders", 10);
        }
Example #9
0
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("Announcements", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Sponsors", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Timeslots", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Tracks", EntitySetRights.AllRead);


            config.SetEntitySetAccessRule("Sessions", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("SessionAttendees", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("People", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Tasks", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Announcements", EntitySetRights.AllRead);

            config.SetEntitySetPageSize("SessionAttendees", 50);

            config.SetServiceOperationAccessRule("Speakers", ServiceOperationRights.AllRead);

            config.SetEntitySetAccessRule("Tags", EntitySetRights.AllRead);

            // remove before deployment
            config.UseVerboseErrors = true;

            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
Example #10
0
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.SetEntitySetAccessRule("Customers", EntitySetRights.All);
     config.SetEntitySetAccessRule("ResidentialCustomers", EntitySetRights.All);
     config.SetEntitySetAccessRule("Users", EntitySetRights.All);
     config.DataServiceBehavior.MaxProtocolVersion       = DataServiceProtocolVersion.V2;
     config.DataServiceBehavior.AcceptProjectionRequests = true;
 }
Example #11
0
 // This method is called only once to initialize service-wide policies.
 public static void InitializeService(DataServiceConfiguration config)
 {
     config.SetEntitySetPageSize("*", 100);
     config.SetEntitySetAccessRule("Dinners", EntitySetRights.AllRead);
     config.SetEntitySetAccessRule("RSVPs", EntitySetRights.AllRead);
     config.SetServiceOperationAccessRule("DinnersNearMe", ServiceOperationRights.AllRead);
     config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
 }
Example #12
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.
     // Examples:
     config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead);
     config.SetEntitySetAccessRule("Countries", EntitySetRights.AllRead);
     // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
 }
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("SalesOrderHeaders", EntitySetRights.AllRead | EntitySetRights.WriteMerge | EntitySetRights.WriteReplace);
            config.SetEntitySetAccessRule("SalesOrderDetails", EntitySetRights.AllRead | EntitySetRights.AllWrite);
            config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead);

            config.UseVerboseErrors = true;
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        }
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("Menus", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Categories", EntitySetRights.AllRead);
            config.SetServiceOperationAccessRule("*", ServiceOperationRights.AllRead);
            config.UseVerboseErrors = true;

            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("Engines", EntitySetRights.All);
            config.SetEntitySetAccessRule("TirePackages", EntitySetRights.All);
            config.SetEntitySetAccessRule("PurchasedCars", EntitySetRights.All);

            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
            config.UseVerboseErrors = true;
        }
Example #16
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.
     // Examples:
     config.SetEntitySetAccessRule("Departments", EntitySetRights.AllRead);
     config.SetEntitySetAccessRule("Employees", EntitySetRights.AllRead);
     config.SetServiceOperationAccessRule("DepartmentsWithLongNames", ServiceOperationRights.All);
     config.SetServiceOperationAccessRule("DepartmentWithLongestName", ServiceOperationRights.All);
     //config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
 }
 // 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("Table_1", EntitySetRights.All);
     config.SetEntitySetAccessRule("Depts", EntitySetRights.All);
     config.SetEntitySetAccessRule("ParentTables", EntitySetRights.All);
     config.SetEntitySetAccessRule("ChildTables", EntitySetRights.All);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
 }
Example #18
0
 // This method is called only once to initialize service-wide policies.
 public static void InitializeService(DataServiceConfiguration config)
 {
     // Grant only the rights needed to support the client application.
     config.SetEntitySetAccessRule("Orders", EntitySetRights.AllRead
                                   | EntitySetRights.WriteMerge
                                   | EntitySetRights.WriteReplace);
     config.SetEntitySetAccessRule("Order_Details", EntitySetRights.AllRead
                                   | EntitySetRights.AllWrite);
     config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead);
 }
Example #19
0
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Presidents", EntitySetRights.AllRead);

            config.SetServiceOperationAccessRule("PresidentsByParty", ServiceOperationRights.AllRead);

            config.SetEntitySetPageSize("Presidents", 10);

            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        }
Example #20
0
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            // We need to explicitly set the less restrictive rights.
            config.SetEntitySetAccessRule("Orders", EntitySetRights.All);
            config.SetEntitySetAccessRule("OrderDetails", EntitySetRights.All);

            // Set the remaining entity sets to read all.
            config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);

            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
Example #21
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);
        }
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("Employees", EntitySetRights.All);
            config.SetEntitySetPageSize("Employees", 20);
            config.SetEntitySetAccessRule("Projects", EntitySetRights.All);
            config.SetEntitySetPageSize("Projects", 20);
            config.SetEntitySetAccessRule("Users", EntitySetRights.All);
            config.SetEntitySetAccessRule("Roles", EntitySetRights.All);

            config.UseVerboseErrors = true;
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        }
Example #23
0
 // This method is called only once to initialize service-wide policies.
 public static void InitializeService(DataServiceConfiguration config)
 {
     //<snippetEnableAccess>
     config.SetEntitySetAccessRule("Customers", EntitySetRights.ReadMultiple);
     config.SetEntitySetAccessRule("Orders", EntitySetRights.AllRead
                                   | EntitySetRights.WriteMerge);
     config.SetEntitySetAccessRule("Order_Details", EntitySetRights.AllRead
                                   | EntitySetRights.AllWrite);
     config.SetEntitySetAccessRule("Products", EntitySetRights.ReadMultiple);
     //</snippetEnableAccess>
     config.SetEntitySetAccessRule("MyTypes", EntitySetRights.AllRead);
 }
Example #24
0
 // This method is called only once to initialize
 //service-wide policies.
 public static void InitializeService(DataServiceConfiguration
                                      config)
 {
     config.SetEntitySetAccessRule("Orders",
                                   EntitySetRights.AllRead |
                                   EntitySetRights.AllWrite);
     config.SetEntitySetAccessRule("Items",
                                   EntitySetRights.AllRead |
                                   EntitySetRights.AllWrite);
     config.DataServiceBehavior.MaxProtocolVersion =
         DataServiceProtocolVersion.V2;
 }
Example #25
0
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("Ladies", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Gentlemen", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("Towns", EntitySetRights.AllRead);

            config.SetEntitySetPageSize("Ladies", 10);
            config.SetEntitySetPageSize("Gentlemen", 10);
            config.SetEntitySetPageSize("Towns", 10);

            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
 public static void InitializeService(DataServiceConfiguration config)
 {
     //TODO: Excersice 1: Task 2b: set rules to indicate which entity sets and service operations are visible, updatable, etc
     // Configure the StudentsInClass operation as read-only.
     config.SetServiceOperationAccessRule("StudentsInClass", ServiceOperationRights.AllRead);
     // Configure all entity sets to permit read and write access.
     config.SetEntitySetAccessRule("Grades", EntitySetRights.All);
     config.SetEntitySetAccessRule("Teachers", EntitySetRights.All);
     config.SetEntitySetAccessRule("Students", EntitySetRights.All);
     config.SetEntitySetAccessRule("Subjects", EntitySetRights.All);
     config.SetEntitySetAccessRule("Users", EntitySetRights.All);
 }
Example #27
0
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            // Set rules to indicate which entity sets and service operations are visible, updatable, etc.
            config.SetEntitySetAccessRule("Users", EntitySetRights.AllRead);
            config.SetEntitySetAccessRule("*", EntitySetRights.All);
            config.SetEntitySetPageSize("*", 50);

#if DEBUG
            config.UseVerboseErrors = true;
#endif
            config.DataServiceBehavior.IncludeAssociationLinksInResponse = true;
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        }
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            config.SetEntitySetAccessRule("Actor", EntitySetRights.All);
            config.SetEntitySetAccessRule("Movie", EntitySetRights.All);
            config.MaxExpandDepth   = 1;
            config.UseVerboseErrors = true;
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        }
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            // Enable access to entity sets and service operations.
            config.SetEntitySetAccessRule("Orders", EntitySetRights.AllRead | EntitySetRights.AllWrite);
            config.SetEntitySetAccessRule("Order_Details", EntitySetRights.AllRead | EntitySetRights.AllWrite);
            config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
            config.SetServiceOperationAccessRule("RegisterForPushNotifications", ServiceOperationRights.ReadSingle);
            config.SetServiceOperationAccessRule("DeleteRegistrations", ServiceOperationRights.ReadSingle);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;

            //// Use for debugging.
            //config.UseVerboseErrors = true;
        }
Example #30
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.
     // Examples:
     config.SetEntitySetAccessRule("*", EntitySetRights.All);
     config.UseVerboseErrors = true;
     config.SetEntitySetAccessRule("Discussion", EntitySetRights.All);
     config.SetEntitySetAccessRule("Attachment",
                                   EntitySetRights.ReadMultiple |
                                   EntitySetRights.ReadSingle |
                                   EntitySetRights.AllWrite);
     // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
     config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
 }