forked from autofac/Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (27 loc) · 967 Bytes
/
Copy pathProgram.cs
File metadata and controls
29 lines (27 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Linq;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
namespace AspNetCoreExample
{
public class Program
{
public static void Main(string[] args)
{
// The ConfigureServices call here allows for
// ConfigureContainer to be supported in Startup with
// a strongly-typed ContainerBuilder. If you don't
// have the call to AddAutofac here, you won't get
// ConfigureContainer support. This also automatically
// calls Populate to put services you register during
// ConfigureServices into Autofac.
var host = WebHost.CreateDefaultBuilder(args)
.ConfigureServices(services => services.AddAutofac())
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}