Skip to content

Commit

Permalink
Fix the issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
unchase committed Jan 7, 2020
1 parent b28c82c commit 2bd4b5a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

These are the changes to each version that has been released on the official [Visual Studio extension gallery](https://marketplace.visualstudio.com/items?itemName=unchase.UnchaseODataConnectedService).

## v1.3.6 `2020-01-07`

- [x] Fix the [issue #22](https://github.com/unchase/Unchase.Odata.Connectedservice/issues/22)

## v1.3.4 `2019-10-20`

- [x] Update icon resolution
Expand Down
15 changes: 12 additions & 3 deletions src/Unchase.OData.ConnectedService/Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Threading.Tasks;
using Microsoft.VisualStudio.ConnectedServices;
using Unchase.OData.ConnectedService.CodeGeneration;
using Unchase.OData.ConnectedService.Models;

namespace Unchase.OData.ConnectedService
{
Expand All @@ -20,12 +19,22 @@ public override async Task<AddServiceInstanceResult> AddServiceInstanceAsync(Con

var codeGenInstance = (Instance)context.ServiceInstance;

try
{
await GenerateCodeAsync(codeGenInstance.ServiceConfig.EdmxVersion, context);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}

var codeGenDescriptor = await GenerateCodeAsync(codeGenInstance.ServiceConfig.EdmxVersion, context);

codeGenInstance.ServiceConfig.FunctionImports = null;
codeGenInstance.ServiceConfig.OperationImports = null;

context.SetExtendedDesignerData<ServiceConfiguration>(codeGenInstance.ServiceConfig);
context.SetExtendedDesignerData(codeGenInstance.ServiceConfig);

await context.Logger.WriteMessageAsync(LoggerMessageCategory.Information, "Adding service instance complete!");

Expand All @@ -43,7 +52,7 @@ public override async Task<UpdateServiceInstanceResult> UpdateServiceInstanceAsy
codeGenInstance.ServiceConfig.FunctionImports = null;
codeGenInstance.ServiceConfig.OperationImports = null;

context.SetExtendedDesignerData<ServiceConfiguration>(codeGenInstance.ServiceConfig);
context.SetExtendedDesignerData(codeGenInstance.ServiceConfig);

await context.Logger.WriteMessageAsync(LoggerMessageCategory.Information, "Updating service instance complete.");

Expand Down
4 changes: 2 additions & 2 deletions src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.4.0")]
[assembly: AssemblyFileVersion("1.3.4.0")]
[assembly: AssemblyVersion("1.3.6.0")]
[assembly: AssemblyFileVersion("1.3.6.0")]
[assembly: NeutralResourcesLanguage("en")]

2 changes: 1 addition & 1 deletion src/Unchase.OData.ConnectedService/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Provider()
BitmapSizeOptions.FromWidthAndHeight(64, 64)
);
CreatedBy = Constants.Author;
Version = new Version(1, 3, 4, 0);
Version = new Version(1, 3, 6, 0);
Version = typeof(Provider).Assembly.GetName().Version;
MoreInfoUri = new Uri(Constants.Website);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4098,7 +4098,7 @@ internal override void WriteGeneratedEdmModel(string escapedEdmxString)

this.Write(@", out edmModel, out errors))
{
global::System.Text.StringBuilder errorMessages = new System.Text.StringBuilder();
global::System.Text.StringBuilder errorMessages = global::new System.Text.StringBuilder();
foreach (var error in errors)
{
errorMessages.Append(error.ErrorMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3801,7 +3801,7 @@ namespace <#= fullNamespace #>

if (!global::Microsoft.OData.Edm.Csdl.CsdlReader.TryParse(reader, <#= this.context.IgnoreUnexpectedElementsAndAttributes ? "true" : "false" #>, out edmModel, out errors))
{
global::System.Text.StringBuilder errorMessages = new System.Text.StringBuilder();
global::System.Text.StringBuilder errorMessages = global::new System.Text.StringBuilder();
foreach (var error in errors)
{
errorMessages.Append(error.ErrorMessage);
Expand Down

0 comments on commit 2bd4b5a

Please sign in to comment.