niisar
4/30/2016 - 5:36 PM

FluentAutofacValidationAPI > App_Start > Startup.Autofac.cs

FluentAutofacValidationAPI > App_Start > Startup.Autofac.cs

using Autofac;
using Autofac.Features.ResolveAnything;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FluentAutofacValidationAPI.App_Start
{
    public partial class Startup
    {
        private static IContainer ConfigureAutofac()
        {
            var builder = new ContainerBuilder();

            builder.RegisterModule<AutofacWebModule>();
            builder.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource());

            var container = builder.Build();
            return container;
        }
    }
}