示例#1
0
 private void Write(EntityContainerConstructor entityContainerConstructor)
 {
     _("public {0}(global::System.Uri serviceRoot, global::System.Func<global::System.Threading.Tasks.Task<string>> accessTokenGetter)",
       entityContainerConstructor.Name);
     using (_builder.IndentBraced)
     {
         _("Context = new {0}(serviceRoot, global::Microsoft.OData.Client.ODataProtocolVersion.V4, accessTokenGetter);", NamesService.GetExtensionTypeName("DataServiceContextWrapper"));
         _("Context.MergeOption = global::Microsoft.OData.Client.MergeOption.OverwriteChanges;");
         _("Context.ResolveName = new global::System.Func<global::System.Type, string>(this.ResolveNameFromType);");
         _("Context.ResolveType = new global::System.Func<string, global::System.Type>(this.ResolveTypeFromName);");
         _("this.OnContextCreated();");
         _("Context.Format.LoadServiceModel = GeneratedEdmModel.GetInstance;");
         _("Context.Format.UseJson();");
     }
     _("partial void OnContextCreated();");
 }
示例#2
0
 private void Write(EntityContainerConstructor entityContainerConstructor)
 {
     _("public {0}(global::System.Uri serviceRoot, global::System.Func<global::System.Threading.Tasks.Task<string>> accessTokenGetter)",
         entityContainerConstructor.Name);
     using (_builder.IndentBraced)
     {
         _("Context = new {0}(serviceRoot, global::Microsoft.OData.Client.ODataProtocolVersion.V4, accessTokenGetter);", NamesService.GetExtensionTypeName("DataServiceContextWrapper"));
         _("Context.MergeOption = global::Microsoft.OData.Client.MergeOption.OverwriteChanges;");
         _("Context.ResolveName = new global::System.Func<global::System.Type, string>(this.ResolveNameFromType);");
         _("Context.ResolveType = new global::System.Func<string, global::System.Type>(this.ResolveTypeFromName);");
         _("this.OnContextCreated();");
         _("Context.Format.LoadServiceModel = GeneratedEdmModel.GetInstance;");
         _("Context.Format.UseJson();");
     }
     _("partial void OnContextCreated();");
 }