You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using Autofac; using Business.Account; using Business.Customer; using Business.ReferralReports; using Business.SendTransaction; using Repository.DAO.Account; using Repository.DAO.ReferralReports; using Repository.DAO.SendTransactionDao; using Repository.Repository.OnlineCustomerDao;
namespace Business.Configuration { public class AutoFacContainer { public static IContainer DIContainer() { var builder = new ContainerBuilder();
#region Services
builder.RegisterType<AccountServices>().As<IAccountServices>(); builder.RegisterType<ReferralReportsServices>().As<IReferralReportsServices>(); builder.RegisterType<CustomerServices>().As<ICustomerServices>(); builder.RegisterType<SendTransactionServices>().As<ISendTransactionServices>();
#endregion Services
#region Repos
builder.RegisterType<AccountRepo>().As<IAccountRepo>(); builder.RegisterType<ReferralReportsRepo>().As<IReferralReportsRepo>(); builder.RegisterType<CustomerRepository>().As<ICustomerRepository>(); builder.RegisterType<SendTransactionRepo>().As<ISendTransactionRepo>(); //builder.RegisterType<AccountRepo>().As<IAccountRepo>();
//builder.RegisterType<AccountRepo>().As<IAccountRepo>();
//builder.RegisterType<AccountRepo>().As<IAccountRepo>();
//builder.RegisterType<AccountRepo>().As<IAccountRepo>();
//builder.RegisterType<AccountRepo>().As<IAccountRepo>();
//builder.RegisterType<AccountRepo>().As<IAccountRepo>();
//builder.RegisterType<AccountRepo>().As<IAccountRepo>();
//builder.RegisterType<AccountRepo>().As<IAccountRepo>();
#endregion Repos
return builder.Build(); }
public static T Resolve<T>() where T : class { var scope = AutoFacContainer.DIContainer().BeginLifetimeScope(); T a = scope.Resolve<T>(); return a; } } }
|