public T Create() { var element = factory.Create(); details.Add(element, index); return(element); }
public IActionResult Details(DetailsResource resource) { var subDepartment = subDepartmentRepo.GetById(resource.SubDepartmentId); if (subDepartment != null) { NotFound(new { Code = HttpStatusCode.NotFound, Message = "This Subdepartment is not found" }); } var details = mapper.Map <DetailsResource, DetailsModel>(resource); repo.Add(details); uow.Save(); var result = mapper.Map <DetailsModel, DetailsResource>(details); return(Ok(result)); }
public IActionResult OnPost() { data.Add(Details); data.Commit(); return(RedirectToPage("./Booklist", new { id = Details.Id })); }