public static IAddCountryService GetAddCountryService() { if (_addCountryService == null) { var notificationHandler = GetNotificationHandler(); var unitOfWork = GetUnitOfWorkCore(); var userLogged = GetUserLogged(); _addCountryService = new AddCountryService(notificationHandler, unitOfWork, userLogged); } return(_addCountryService); }
/// <summary> /// Returna instance of <see cref="ImportCountryService"/>. /// </summary> /// <param name="notificationHandler">Handling error notification messages.</param> /// <param name="unitOfWork">Context to read and writing countries.</param> /// <param name="addCountryService">Service do add countries in database.</param> public ImportCountryService(INotificationHandler notificationHandler, IUnitOfWorkCore unitOfWork, IUserLogged userLogged, IAddCountryService addCountryService) : base(notificationHandler, unitOfWork, userLogged) { _addCountryService = addCountryService ?? throw new ArgumentNullException(nameof(addCountryService)); }