Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

.net 6 autofac

var builder = WebApplication.CreateBuilder(args);

// The UseServiceProviderFactory call attaches the
// Autofac provider to the generic hosting mechanism.

builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());

// Add services to the container.
builder.Services.AddControllersWithViews();

//Register your own things directly with Autofac here
builder.Host.ConfigureContainer<ContainerBuilder>(builder => builder.RegisterType<Service>().As<IService>());

var app = builder.Build();
Comment

PREVIOUS NEXT
Code Example
Csharp :: asp.net core 6 autofac 
Csharp :: sorting list by date time dec in c# 
Csharp :: c# yield keyword 
Csharp :: c# foreach namevaluecollection 
Csharp :: should i learn c # 
Csharp :: how to close another app in system with c# 
Csharp :: which game engine is best 
Csharp :: how to trim path in C# 
Csharp :: unity button not working 
Csharp :: c# Program to check if a given year is leap year 
Csharp :: C# api get value from header 
Csharp :: set text in unity invisible 
Csharp :: exception handling in c# web api 
Csharp :: enable cors asp.net mvc 
Csharp :: c# const vs readonly 
Csharp :: microsoft forms create bitmap 
Csharp :: c# math method to reverse negative or positive 
Csharp :: how to create url parameters for URi C# 
Csharp :: c# get a value from value tuple list 
Csharp :: How can I display image from database in asp.net mvc. I created image table and image path as varchar 
Csharp :: how to return a value in c# 
Csharp :: c# generate random int list 
Csharp :: setting the parent of a transform which resides in a prefab 
Csharp :: IsInstanceOf nunit 
Csharp :: pubxml environment variables 
Csharp :: how to make a block disappear in unity 
Csharp :: wpf change foreground c# 
Csharp :: serialize xml as array C# 
Csharp :: Convert integers to written numbers C# 
Csharp :: minimum of three numbers 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =