示例#1
0
 public BlogController(IArticleService articles, IMapper mapper, IMemoryCache cache, ICustomErrorService customErrors)
 {
     this.articles     = articles ?? throw new ArgumentNullException("Articles service cannot be null.");
     this.mapper       = mapper ?? throw new ArgumentNullException("Mapper cannot be null.");
     this.cache        = cache ?? throw new ArgumentNullException("Cache cannot be null.");
     this.customErrors = customErrors ?? throw new ArgumentNullException("CustomError service cannot be null.");
 }
示例#2
0
 public MessageController(
     IMessageService messagesService,
     IUserService usersService,
     IEmailSenderService emailSenderService,
     ICustomErrorService customErrors,
     IMapper mapper)
 {
     this.messagesService    = messagesService ?? throw new ArgumentNullException("Messages service cannot be null.");
     this.usersService       = usersService ?? throw new ArgumentNullException("Users service cannot be null.");
     this.emailSenderService = emailSenderService ?? throw new ArgumentNullException("EmailSender service cannot be null.");
     this.customErrors       = customErrors ?? throw new ArgumentNullException("CustomError service cannot be null.");
     this.mapper             = mapper ?? throw new ArgumentNullException("Mapper cannot be null.");
 }