annotate Demo/WebServices/NorthwindDataService/EFDataService.svc.cs @ 9:1e85f66cf767 default tip

update bltoolkit
author nickolay
date Thu, 05 Apr 2018 20:53:26 +0300
parents f990fcb411a9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
1 using System;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
2 using System.Data.Metadata.Edm;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
3 using System.Data.Objects;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
4 using System.Data.Services;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
5 using System.Data.Services.Common;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
6
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
7 namespace NorthwindDataService
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
8 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
9 public class EFDataService : DataService<NorthwindEntities>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
10 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
11 // This method is called only once to initialize service-wide policies.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
12 public static void InitializeService(DataServiceConfiguration config)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
13 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
14 var w = new MetadataWorkspace();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
15 var m = new ObjectStateManager(w);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
16
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
17 // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
18 // Examples:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
19 config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
20 // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
21 config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
22 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
23 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
24 }