-
-
Save llaszko/4143edda2eb7a8118e54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Autofac; | |
namespace TestApp | |
{ | |
class Program | |
{ | |
public class Component_0 | |
{ | |
public Component_0() | |
{ | |
Console.WriteLine("Activated!"); | |
} | |
} | |
static void Main(string[] args) | |
{ | |
var builder = new ContainerBuilder(); | |
var container = builder.Build(); | |
var lifetime = container.BeginLifetimeScope(cb => | |
{ | |
cb | |
.RegisterType<Component_0>() | |
.AutoActivate(); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment