Skip to content
Permalink
Browse files

Update c# version and fix OpenAPi options issue

  • Loading branch information
farajfarook committed Nov 23, 2019
1 parent d72abb9 commit 47c90344ba813b47096262e148042454f60f6bf9
@@ -1,6 +1,6 @@
env:
global:
- PACKAGE_VERSION="3.0.0-rc6"
- PACKAGE_VERSION="3.0.0-rc7"
- PACKAGE_ICON="https://www.enbiso.com/logo.svg"
- PACKAGE_PROJECT="https://nlib.enbiso.com"
- PACKAGE_REPO="https://github.com/enbiso/Enbiso.NLib"
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -22,6 +22,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>

</PropertyGroup>

@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

</Project>
@@ -19,6 +19,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.*" />
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.0.*" />
@@ -21,7 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>

<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="4.1.*" />
@@ -22,6 +22,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -18,6 +18,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.0.*" />
@@ -19,6 +19,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="4.6.*" />
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Enbiso.NLib.GlobalExceptions
@@ -8,7 +9,7 @@ namespace Enbiso.NLib.GlobalExceptions
/// </summary>
public interface IGlobalExceptionHandler
{
Type[] ValidTypes { get; }
IEnumerable<Type> ValidTypes { get; }

Task<GlobalExceptionResponse> HandleException(Exception exception);
}
@@ -20,7 +21,7 @@ public interface IGlobalExceptionHandler
public abstract class GlobalExceptionHandler<TException> : IGlobalExceptionHandler
where TException : Exception
{
public Type[] ValidTypes => new [] { typeof(TException) };
public IEnumerable<Type> ValidTypes => new [] { typeof(TException) };
protected abstract Task<GlobalExceptionResponse> Handle(TException ex);

public Task<GlobalExceptionResponse> HandleException(Exception exception)
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.0.*" />
@@ -21,6 +21,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.*" />
@@ -22,6 +22,7 @@
<PackageIconUrl>$(PACKAGE_ICON)</PackageIconUrl>
<PackageProjectUrl>$(PACKAGE_PROJECT)</PackageProjectUrl>
<RepositoryUrl>$(PACKAGE_REPO)</RepositoryUrl>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -19,8 +19,13 @@ public static class ServiceExtensions
/// <param name="optBuilder"></param>
public static void AddOpenApi(this IServiceCollection services, Action<OpenApiOptions> optBuilder)
{
services.AddOptions();

optBuilder ??= options => {};
services.Configure(optBuilder);

var opts = new OpenApiOptions();
optBuilder?.Invoke(opts);
optBuilder.Invoke(opts);

services.AddSwaggerGen(c =>
{

0 comments on commit 47c9034

Please sign in to comment.
You can’t perform that action at this time.