public void TestInitialize() { _countryDAL = Substitute.For <ICountryDAL>(); _countryList = new List <ICountry>() { new Country(Guid.NewGuid(), "Japan"), new Country(Guid.NewGuid(), "France"), new Country(Guid.NewGuid(), "Spain") }; }
public CountryBLL(ICountryDAL countryDal, UserInfo userInfo, ILogger <CountryBLL> logger) { _countryDal = countryDal; _userInfo = userInfo; _logger = logger; }
public CountryService(ICountryDAL countryDAL) { if (countryDAL == null) { throw new ArgumentNullException("Argument cannot be null", nameof(countryDAL)); } CountryDAL = countryDAL; }
/// <summary> /// Hàm này phải được gọi để khởi tạo các chức năng tác nghiệp /// </summary> /// <param name="connectionString"></param> public static void Initialize(string connectionString) { SupplierDB = new DataLayers.SqlServer.SupplierDAL(connectionString); CustomerDB = new DataLayers.SqlServer.CustomerDAL(connectionString); ShipperDB = new DataLayers.SqlServer.ShipperDAL(connectionString); CategoryDB = new DataLayers.SqlServer.CategoryDAL(connectionString); ProductDB = new DataLayers.SqlServer.ProductDAL(connectionString); CountryDB = new DataLayers.SqlServer.CountryDAL(connectionString); }
public CountryBLL(ICountryDAL countryDal, LogAdapter logger, UserInfo userInfo) { _countryDal = countryDal; _logger = logger; _userInfo = userInfo; _logger.Initial(this.GetType().Name); }
public CountyBLL(ICountyDAL countyDal, ICountryDAL countryDal, ILogger <CountyBLL> logger, UserInfo userInfo) { _countyDal = countyDal; _countryDal = countryDal; _logger = logger; _userInfo = userInfo; }
/// <summary> /// Khởi tạo tính năng tác nghiệp (Hàm này phải được gọi nếu muốn sử dụng các tính năng của lớp) /// </summary> /// <param name="dbType"></param> /// <param name="connectionString"></param> public static void Init(DatabaseTypes dbType, string connectionString) { switch (dbType) { case DatabaseTypes.SQLServer: CountryDB = new DataLayers.SQLServer.CountryDAL(connectionString); CityDB = new DataLayers.SQLServer.CityDAL(connectionString); SupplierDB = new DataLayers.SQLServer.SupplierDAL(connectionString); CategoryDB = new DataLayers.SQLServer.CategoryDAL(connectionString); CustomerDB = new DataLayers.SQLServer.CustomerDAL(connectionString); EmployeeDB = new DataLayers.SQLServer.EmployeeDAL(connectionString); ShipperDB = new DataLayers.SQLServer.ShipperDAL(connectionString); break; default: throw new Exception("Database Type is not Supported"); } }
public static void Initialize(string connectionString) { CountryDB = new CountryDAL(connectionString); }
public CountryService(ICountryDAL countryDAL, ICityDAL cityDAL, IDistrictDAL districtDAL) { _countryDAL = countryDAL; _cityDAL = cityDAL; _districtDAL = districtDAL; }
public CountryManager(ICountryDAL countryDal) { _countryDal = countryDal; }
public CountryService(ICountryDAL countryDAL) { _countryDAL = countryDAL; }
public CountryManager(ICountryDAL context) { _context = context; }