protected override BaseCodeGenDescriptor CreateV4CodeGenDescriptor(IFileHandler fileHandler, IMessageLogger messageLogger, IPackageInstaller packageInstaller) { var descriptor = new TestCodeGenDescriptor(fileHandler, messageLogger, packageInstaller); descriptor.Version = "V4"; CreatedInstance = CreatedInstance ?? descriptor; return descriptor; }
private async Task <BaseCodeGenDescriptor> GenerateCodeAsync(string metadataUri, Version edmxVersion, ConnectedServiceHandlerContext context, Project project) { string outputDirectory = ""; if (context.HandlerHelper != null) { string serviceReferenceFolderName = context.HandlerHelper.GetServiceArtifactsRootFolder(); outputDirectory = Path.Combine( project.GetFullPath(), serviceReferenceFolderName, context.ServiceInstance.Name); } LanguageOption languageOption; if (project != null) { languageOption = project.GetLanguageOption(); } else { languageOption = LanguageOption.GenerateCSharpCode; } BaseCodeGenDescriptor codeGenDescriptor = codeGenDescriptorFactory.Create(edmxVersion, new ConnectedServiceFileHandler(context, project), new ConnectedServiceMessageLogger(context), new ConnectedServicePackageInstaller(context, project, new ConnectedServiceMessageLogger(context))); await codeGenDescriptor.AddNugetPackagesAsync().ConfigureAwait(false); await codeGenDescriptor.AddGeneratedClientCodeAsync(metadataUri, outputDirectory, (Microsoft.OData.CodeGen.Common.LanguageOption) languageOption, ((ODataConnectedServiceInstance)context.ServiceInstance).ServiceConfig).ConfigureAwait(false); return(codeGenDescriptor); }
protected override BaseCodeGenDescriptor CreateV4CodeGenDescriptor(string metadataUri, ConnectedServiceHandlerContext context, Project project) { var descriptor = new TestCodeGenDescriptor(metadataUri, context, project); descriptor.Version = "V4"; CreatedInstance = CreatedInstance ?? descriptor; return(descriptor); }
private async Task <BaseCodeGenDescriptor> GenerateCodeAsync(string metadataUri, Version edmxVersion, ConnectedServiceHandlerContext context, Project project) { BaseCodeGenDescriptor codeGenDescriptor = codeGenDescriptorFactory.Create(edmxVersion, metadataUri, context, project); await codeGenDescriptor.AddNugetPackagesAsync().ConfigureAwait(false); await codeGenDescriptor.AddGeneratedClientCodeAsync().ConfigureAwait(false); return(codeGenDescriptor); }