public async Task <IActionResult> Details(Guid?id) { if (id == null) { return(RecordNotFound()); } var getOperation = await _bo.ReadAsync((Guid)id); if (!getOperation.Success) { return(OperationErrorBackToIndex(getOperation.Exception)); } if (getOperation.Result == null) { return(RecordNotFound()); } var vm = ServiceVM.Parse(getOperation.Result); var crumbs = GetCrumbs(); crumbs.Add(new BreadCrumb() { Action = "Details", Controller = "Services", Icon = "fa-info-circle", Text = "Details" }); ViewData["Title"] = "Service details"; ViewData["BreadCrumbs"] = crumbs; return(View(vm)); }
public void TestCreateAndListServiceAsync() { ApplicationSeeder.Seed(); var bo = new ServiceBO(); var service = new Service("Moving property", "Transporting property/belongings", true); var resCreate = bo.CreateAsync(service).Result; var resGet = bo.ReadAsync(service.Id).Result; Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null); }
private async Task <ServiceVM> GetServiceViewModel(Guid id) { var getOperation = await _serviceBO.ReadAsync(id); return(ServiceVM.Parse(getOperation.Result)); }