annotate Demo/WebServices/NorthwindDataService/EFDataService.svc.cs @ 4:f757da6161a1

!bug 100 + 2h fixed gregression
author cin
date Sun, 24 Aug 2014 17:57:42 +0400
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 }