-
Notifications
You must be signed in to change notification settings - Fork 54
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
base: master
Are you sure you want to change the base?
Changes from all commits
e41ab6b
c6315ab
a12aed6
c60f84a
d89b380
f2160cd
d80a4f2
d7e27a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,6 @@ | |
"Default": "Warning" | ||
} | ||
}, | ||
"Console": { | ||
"LogLevel": { | ||
"Default": "Warning" | ||
} | ||
} | ||
"IncludeScopes": false | ||
} | ||
} |
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> |
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>(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 => | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 => | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||||||
}; | ||||||
}); | ||||||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.