public IActionResult Add() { LibrarianBindingModel model = new LibrarianBindingModel(); model.LibraryId = this.userService.GetUserLibraryId(this.User.Identity.Name); model.Library = this.libraryService.GetLibraryDetails(model.LibraryId).Name; return(this.View(model)); }
public IActionResult Add(LibrarianBindingModel model) { if (!ModelState.IsValid) { return(this.View(model)); } var dto = this.mapper.Map <LibrarianDTO>(model); bool result = this.libraryService.AddLibrarian(dto); return(this.Redirect("/")); }