public void TestCreateAndReadBrandAsync() { ContextSeeder.Seed(); var bo = new BrandBusinessObject(); var reg = new Brand("Dona Ermelinda"); var resCreate = bo.CreateAsync(reg).Result; var resGet = bo.ReadAsync(reg.Id).Result; Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null); }
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 = BrandViewModel.Parse(getOperation.Result); Draw("Details", "fa-search"); return(View(vm)); }
private async Task <BrandViewModel> GetBrandViewModel(Guid id) { var getOperation = await _bbo.ReadAsync(id); return(BrandViewModel.Parse(getOperation.Result)); }