Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to .NET 6.0 (updated NuGet packages/APIs) #13

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ namespace PaymentService.Controllers
[Route("api/[controller]")]
public class PaymentController : Controller
{
private readonly List<string> _paymentStatuses = new List<string> { "Accepted", "Rejected" };
private readonly List<string> _cardTypes = new List<string> { "Visa", "Master Card", "American Express" };
public List<string> CardTypes { get; } = new() { "Visa", "Master Card", "American Express" };

public List<string> PaymentStatuses { get; } = new() { "Accepted", "Rejected" };

[HttpPost]
[Route("performpayment")]
Expand All @@ -22,8 +23,8 @@ public IEnumerable<string> PerformPayment(int userId, string reference)
// the payment system returns the response in a list of string like this: payment status, card type, card number, user and reference
return new[]
{
_paymentStatuses[new Random().Next(0, 2)],
_cardTypes[new Random().Next(0, 3)],
PaymentStatuses[new Random().Next(0, 2)],
CardTypes[new Random().Next(0, 3)],
Guid.NewGuid().ToString(),
userId.ToString(),
reference
Expand Down
2 changes: 1 addition & 1 deletion ExternalSystem/PaymentService/PaymentService.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish>https://paymentserviceexternal.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<<<<<<< HEAD
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heads up, looks like you forgot to resolve this conflict

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely didn't forget but maybe I forgot a push. I'll go back and take a look and button this up a bit more snugly. I am taking a Windows laptop with me on a working vacation next week so I hope to run "natively" on Service Mesh. I was locked in an AWS VDI at a client site and that hampered things a bit. Once I'm "on metal" I can submit something much more robust.

<TargetFramework>netcoreapp3.1</TargetFramework>
=======
<TargetFramework>net6.0</TargetFramework>
>>>>>>> template/master
<ProjectGuid>8504d9b8-c4e8-4172-8da3-cbd9971e3207</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>paymentserviceexternal.scm.azurewebsites.net:443</MSDeployServiceURL>
Expand Down
6 changes: 1 addition & 5 deletions ExternalSystem/PaymentService/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"Default": "Warning"
}
},
"Console": {
"LogLevel": {
"Default": "Warning"
}
}
"IncludeScopes": false
}
}
12 changes: 6 additions & 6 deletions ServiceFabric/Linux/DuberMicroservices/DuberMicroservices.sfproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets=";ValidateMSBuildFiles">
<Import Project="..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />
<Import Project="..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />
<PropertyGroup Label="Globals">
<ProjectGuid>d8a868b6-7d03-4368-a52e-64f1e1b357db</ProjectGuid>
<ProjectVersion>2.1</ProjectVersion>
<MinToolsVersion>1.5</MinToolsVersion>
<SupportedMSBuildNuGetPackageVersion>1.6.6</SupportedMSBuildNuGetPackageVersion>
<SupportedMSBuildNuGetPackageVersion>1.7.6</SupportedMSBuildNuGetPackageVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
Expand Down Expand Up @@ -40,9 +40,9 @@
<ApplicationProjectTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.targets</ApplicationProjectTargetsPath>
</PropertyGroup>
<Import Project="$(ApplicationProjectTargetsPath)" Condition="Exists('$(ApplicationProjectTargetsPath)')" />
<Import Project="..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" />
<Target Name="ValidateMSBuildFiles">
<Error Condition="!Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" Text="Unable to find the '..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
<Error Condition="!Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
<Import Project="..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" />
<Target Name="ValidateMSBuildFiles" BeforeTargets="PrepareForBuild">
<Error Condition="!Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" Text="Unable to find the '..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
<Error Condition="!Exists('..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '..\..\..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
</Target>
</Project>
2 changes: 1 addition & 1 deletion ServiceFabric/Linux/DuberMicroservices/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudio.Azure.Fabric.MSBuild" version="1.6.6" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Azure.Fabric.MSBuild" version="1.7.6" targetFramework="net461" />
</packages>
Empty file added main.tf
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
using Duber.Infrastructure.EventBus.Abstractions;
using Duber.Invoice.API.Application.IntegrationEvents.Events;
using MediatR;
using System.Threading;

namespace Duber.Invoice.API.Application.DomainEventHandlers
{
public class InvoiceCreatedDomainEventHandler : IAsyncNotificationHandler<InvoiceCreatedDomainEvent>
public class InvoiceCreatedDomainEventHandler : INotificationHandler<InvoiceCreatedDomainEvent>
{
private readonly IEventBus _eventBus;
private readonly IMapper _mapper;
Expand All @@ -19,7 +20,7 @@ public InvoiceCreatedDomainEventHandler(IEventBus eventBus, IMapper mapper)
_mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
}

public async Task Handle(InvoiceCreatedDomainEvent notification)
public async Task Handle(InvoiceCreatedDomainEvent notification, CancellationToken cancellationToken)
{
// to update the query side (materialized view)
var integrationEvent = _mapper.Map<InvoiceCreatedIntegrationEvent>(notification);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
using Duber.Infrastructure.EventBus.Abstractions;
using Duber.Invoice.API.Application.IntegrationEvents.Events;
using MediatR;
using System.Threading;

namespace Duber.Invoice.API.Application.DomainEventHandlers
{
public class InvoicePaidDomainEventHandler : IAsyncNotificationHandler<InvoicePaidDomainEvent>
public class InvoicePaidDomainEventHandler : INotificationHandler<InvoicePaidDomainEvent>
{
private readonly IEventBus _eventBus;
private readonly IMapper _mapper;
Expand All @@ -19,7 +20,7 @@ public InvoicePaidDomainEventHandler(IEventBus eventBus, IMapper mapper)
_mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
}

public async Task Handle(InvoicePaidDomainEvent notification)
public async Task Handle(InvoicePaidDomainEvent notification, CancellationToken cancellationToken)
{
// to update the query side (materialized view)
var integrationEvent = _mapper.Map<InvoicePaidIntegrationEvent>(notification);
Expand Down
23 changes: 12 additions & 11 deletions src/Application/Duber.Invoice.API/Duber.Invoice.API.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

Expand All @@ -20,16 +20,17 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.2" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.2.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="8.6.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.4.10" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.12.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.1" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="3.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="10.4.0" />
<PackageReference Include="MediatR" Version="10.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.20.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.4" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
using System.Collections.Generic;
using System.Reflection;
using Autofac;
using Autofac;
using Duber.Invoice.API.Application.DomainEventHandlers;
using MediatR;
using System.Collections.Generic;
using System.Reflection;

namespace Duber.Invoice.API.Infrastructure.AutofacModules
{
public class MediatorModule : Autofac.Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterAssemblyTypes(typeof(IMediator).GetTypeInfo().Assembly)
.AsImplementedInterfaces();

// Register all the event classes (they implement IAsyncNotificationHandler) in assembly holding the Commands
Autofac.Builder.IRegistrationBuilder<Mediator, Autofac.Builder.ConcreteReflectionActivatorData, Autofac.Builder.SingleRegistrationStyle> registrationBuilder2 = builder.RegisterType<Mediator>().As<IMediator>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious if we could get rid of the variable since you're not using it

Suggested change
Autofac.Builder.IRegistrationBuilder<Mediator, Autofac.Builder.ConcreteReflectionActivatorData, Autofac.Builder.SingleRegistrationStyle> registrationBuilder2 = builder.RegisterType<Mediator>().As<IMediator>();
builder.RegisterType<Mediator>().As<IMediator>();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was in "first do no harm" mode - and just wanted it to build/clear all warnings. That was in the info category and can certainly get rid of it.


// Register all the event classes (they implement INotificationHandler) in assembly holding the Commands
builder.RegisterAssemblyTypes(typeof(InvoiceCreatedDomainEventHandler).GetTypeInfo().Assembly)
.AsClosedTypesOf(typeof(IAsyncNotificationHandler<>));
.AsClosedTypesOf(typeof(INotificationHandler<>)).AsImplementedInterfaces().InstancePerRequest();

builder.Register<SingleInstanceFactory>(context =>
Autofac.Builder.IRegistrationBuilder<ServiceFactory, Autofac.Builder.SimpleActivatorData, Autofac.Builder.SingleRegistrationStyle> registrationBuilder1 = builder.Register<ServiceFactory>(context =>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

{
var componentContext = context.Resolve<IComponentContext>();
return t => { object o; return componentContext.TryResolve(t, out o) ? o : null; };
IComponentContext componentContext = context.Resolve<IComponentContext>();
return t =>
{
ServiceFactory p = t => { return componentContext.TryResolve(t, out object o) ? o : null; };
return t;
};
});

builder.Register<MultiInstanceFactory>(context =>
Autofac.Builder.IRegistrationBuilder<ServiceFactory, Autofac.Builder.SimpleActivatorData, Autofac.Builder.SingleRegistrationStyle> registrationBuilder = builder.Register<ServiceFactory>(context =>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

{
var componentContext = context.Resolve<IComponentContext>();

IComponentContext componentContext = context.Resolve<IComponentContext>();
return t =>
{
var resolved = (IEnumerable<object>)componentContext.Resolve(typeof(IEnumerable<>).MakeGenericType(t));
IEnumerable<object> resolved = (IEnumerable<object>)componentContext.Resolve(typeof(IEnumerable<>).MakeGenericType(t));
return resolved;
};
});
Expand Down
4 changes: 2 additions & 2 deletions src/Application/Duber.Invoice.API/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Startup(IConfiguration configuration)
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services
.AddAutoMapper()
.AddAutoMapper(typeof(Startup))
.AddApplicationInsightsTelemetry(Configuration)
.AddControllers(options =>
{
Expand Down Expand Up @@ -72,7 +72,7 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Duber.Domain.Trip.Events;
using Duber.Infrastructure.EventBus.Abstractions;
using Duber.Trip.API.Application.IntegrationEvents;
using Kledex.Events;
using OpenCqrs.Events;
using Microsoft.Extensions.Logging;

namespace Duber.Trip.API.Application.DomainEventHandlers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Duber.Infrastructure.EventBus.Idempotency;
using Duber.Trip.API.Application.IntegrationEvents;
using Duber.Trip.API.Application.Model;
using Kledex.Events;
using OpenCqrs.Events;
using Microsoft.Extensions.Logging;
using TripStatus = Duber.Domain.SharedKernel.Model.TripStatus;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Net;
using System.Threading.Tasks;
using Duber.Trip.API.Infrastructure.Repository;
using Kledex.Store.Cosmos.Mongo.Documents;
using OpenCqrs.Store.Cosmos.Mongo.Documents;
using Microsoft.AspNetCore.Mvc;

namespace Duber.Trip.API.Controllers
Expand Down
4 changes: 2 additions & 2 deletions src/Application/Duber.Trip.API/Controllers/TripController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using System.Threading.Tasks;
using AutoMapper;
using Duber.Domain.Trip.Commands;
using Kledex;
using Kledex.Domain;
using OpenCqrs;
using OpenCqrs.Domain;
using Microsoft.ApplicationInsights.AspNetCore.Extensions;
using Microsoft.AspNetCore.Mvc;
using Action = Duber.Domain.Trip.Commands.Action;
Expand Down
22 changes: 12 additions & 10 deletions src/Application/Duber.Trip.API/Duber.Trip.API.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

Expand All @@ -18,15 +18,17 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="3.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.2" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="8.6.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.12.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.1" />
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.4" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
<PackageReference Include="OpenCqrs" Version="6.5.0" />
<PackageReference Include="OpenCqrs.Store.Cosmos.Mongo" Version="6.5.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="10.4.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.20.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
using Duber.Infrastructure.EventBus.Idempotency;
using Duber.Infrastructure.EventBus.RabbitMQ.IoC;
using Duber.Infrastructure.EventBus.ServiceBus.IoC;
using Kledex;
using Kledex.Commands;
using Kledex.Configuration;
using Kledex.Domain;
using Kledex.Events;
using Kledex.Extensions;
using Kledex.Queries;
using Kledex.Store.Cosmos.Mongo.Configuration;
using OpenCqrs;
using OpenCqrs.Commands;
using OpenCqrs.Configuration;
using OpenCqrs.Domain;
using OpenCqrs.Events;
using OpenCqrs.Extensions;
using OpenCqrs.Queries;
using OpenCqrs.Store.Cosmos.Mongo.Configuration;
using Microsoft.OpenApi.Models;
using Kledex.Store.Cosmos.Mongo.Extensions;
using OpenCqrs.Store.Cosmos.Mongo.Extensions;
using MongoDB.Bson.Serialization;
using Microsoft.Extensions.Diagnostics.HealthChecks;

Expand Down Expand Up @@ -72,7 +72,7 @@ public static IServiceCollection AddCustomSwagger(this IServiceCollection servic
/// <param name="setupAction"></param>
/// <param name="types"></param>
/// <returns></returns>
public static IKledexServiceBuilder AddCustomKledex(this IServiceCollection services, Action<MainOptions> setupAction, params Type[] types)
public static IOpenCqrsServiceBuilder AddCustomKledex(this IServiceCollection services, Action<MainOptions> setupAction, params Type[] types)
{
var typeList = types.ToList();
typeList.Add(typeof(IDispatcher));
Expand All @@ -85,7 +85,7 @@ public static IKledexServiceBuilder AddCustomKledex(this IServiceCollection serv
services.AddTransient(typeof(IRepository<>), typeof(Repository<>));
services.AddCustomAutoMapper(typeList);
services.Configure(setupAction);
return new KledexServiceBuilder(services);
return new OpenCqrsServiceBuilder(services);
}

private static IServiceCollection AddCustomAutoMapper(this IServiceCollection services, List<Type> types)
Expand Down
Loading