Mercurial > pub > bltoolkit
comparison Demo/WebServices/NorthwindDataService/EFDataService.svc.cs @ 0:f990fcb411a9
Копия текущей версии из github
| author | cin |
|---|---|
| date | Thu, 27 Mar 2014 21:46:09 +0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:f990fcb411a9 |
|---|---|
| 1 using System; | |
| 2 using System.Data.Metadata.Edm; | |
| 3 using System.Data.Objects; | |
| 4 using System.Data.Services; | |
| 5 using System.Data.Services.Common; | |
| 6 | |
| 7 namespace NorthwindDataService | |
| 8 { | |
| 9 public class EFDataService : DataService<NorthwindEntities> | |
| 10 { | |
| 11 // This method is called only once to initialize service-wide policies. | |
| 12 public static void InitializeService(DataServiceConfiguration config) | |
| 13 { | |
| 14 var w = new MetadataWorkspace(); | |
| 15 var m = new ObjectStateManager(w); | |
| 16 | |
| 17 // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc. | |
| 18 // Examples: | |
| 19 config.SetEntitySetAccessRule("*", EntitySetRights.AllRead); | |
| 20 // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All); | |
| 21 config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; | |
| 22 } | |
| 23 } | |
| 24 } |
