Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

register all services microsoft .net core dependency injection container

service.RegisterAssemblyPublicNonGenericClasses(… your assembly ref goes here …)
.Where(x => x.Name.EndsWith(“Service”))  //optional
.IgnoreThisInterface<IMyInterface>()     //optional
.AsPublicImplementedInterfaces(ServiceLifetime.Scoped);
Source by www.thereformedprogrammer.net #
 
PREVIOUS NEXT
Tagged: #register #services #microsoft #core #dependency #injection #container
ADD COMMENT
Topic
Name
4+1 =