//DI in action public DataController(IAccountService AccService, IBudgetService BudgetService, IHouseholdService HouseholdService, ISecurityService SecurityService, ILoggingService LoggingService) { _accService = AccService ?? throw new ArgumentNullException(nameof(AccService)); _budgetService = BudgetService ?? throw new ArgumentNullException(nameof(BudgetService)); _hhService = HouseholdService ?? throw new ArgumentNullException(nameof(HouseholdService)); _securityService = SecurityService ?? throw new ArgumentNullException(nameof(SecurityService)); _logService = LoggingService ?? throw new ArgumentNullException(nameof(LoggingService)); }
public HouseholdsController(IHouseholdService householdService, IMapingService mappingService, IWebHelper webHelper) : base(mappingService, webHelper) { if (householdService == null) { throw new ArgumentNullException(String.Format(ExceptionConstants.ArgumentCannotBeNull, "householdService")); } this.householdService = householdService; }
public HomeController(IUserService userService, IHouseholdService householdService, IExpenseService expenseService) { if (userService == null) { throw new ArgumentNullException(string.Format(ExceptionConstants.ArgumentCannotBeNull, "userService")); } if (householdService == null) { throw new ArgumentNullException(string.Format(ExceptionConstants.ArgumentCannotBeNull, "householdService")); } if (expenseService == null) { throw new ArgumentNullException(string.Format(ExceptionConstants.ArgumentCannotBeNull, "expenseService")); } this.userService = userService; this.householdService = householdService; this.expenseService = expenseService; }
public HouseholdController(IUserService userService, IHouseholdService householdService, IImageService imageService, IMapingService mappingService, IWebHelper webHelper) : base(mappingService, webHelper) { if (userService == null) { throw new ArgumentNullException(string.Format(ExceptionConstants.ArgumentCannotBeNull, "userService")); } if (householdService == null) { throw new ArgumentNullException(string.Format(ExceptionConstants.ArgumentCannotBeNull, "householdService")); } if (imageService == null) { throw new ArgumentNullException(string.Format(ExceptionConstants.ArgumentCannotBeNull, "imageService")); } this.userService = userService; this.householdService = householdService; this.imageService = imageService; }
public Controller(IHouseholdService householdService, IHousekeepingBookWriter housekeepingBookWriter) { _householdService = householdService; _housekeepingBookWriter = housekeepingBookWriter; }