public UserController(ISessionHandler sessionHandler, IBookContainer bookContainer, IMiddleware middleware, IUserContainer userContainer) { this._userContainer = userContainer; this._bookContainer = bookContainer; this._sessionHandler = sessionHandler; this._middleware = middleware; }
public BookController(IBookContainer bookContainer, ISectorContainer sectorContainer, ICourseContainer courseContainer, ISessionHandler sessionHandler, IMiddleware middleware) { this._bookContainer = bookContainer; this._sectorContainer = sectorContainer; this._courseContainer = courseContainer; this._sessionHandler = sessionHandler; this._middleware = middleware; }
public LibraryContainer(IAuthorContainer authors, IBookContainer books, ICategoryContainer categories, IUserContainer users, IBorrowedContainer borrowed, ISettingsContainer settings) { this.authors = authors; this.books = books; this.categories = categories; this.users = users; this.borrowed = borrowed; this.settings = settings; }
public async Task ValidateAsync(IBookContainer bookContainer) { if (bookContainer == null) { throw new ArgumentNullException(nameof(bookContainer)); } var book = await this.GetBy(bookContainer); if (bookContainer.BookId.HasValue && book == null) { throw new InvalidOperationException($"Book not found by id {bookContainer.BookId}"); } }
public async Task ValidateAsync(IBookContainer container) { if (container is null) { throw new ArgumentNullException(nameof(container)); } var entity = await BookDataAccess.GetByAsync(container); if (entity is null) { throw new InvalidOperationException($"Book not found by ID {container.BookId}"); } }
public BookController(IBookContainer booksContainer)//, IAuthorContainer authorsContainer) { _booksContainer = booksContainer; //_authorsContainer = authorsContainer; }
public async Task <Book> GetByAsync(IBookContainer book) { return(book.BookId.HasValue ? this.Mapper.Map <Book>(await this.Context.Book.FirstOrDefaultAsync(x => x.Id == book.BookId)) : null); }
public BookProvider(IBookContainer books) { this.books = books; }
private Task <Book> GetBy(IBookContainer bookContainer) { return(this.BookDataAccess.GetByAsync(bookContainer)); }
public async Task <Book> GetByAsync(IBookContainer container) { return(Mapper.Map <Book>(await Context.Books.FirstOrDefaultAsync(x => x.Id == container.BookId))); }
public HomeController(IBookContainer bookContainer, IMiddleware middleware) { this._bookContainer = bookContainer; this._middleware = middleware; }