public async Task <ActionResult <SubCategoryType> > PostSubCategoryType(SubCategoryType subCategoryType) { _context.SubCategoryTypes.Add(subCategoryType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSubCategoryType", new { id = subCategoryType.SubCategoryTypeId }, subCategoryType)); }
public async Task <IActionResult> PutSubCategoryType(int id, SubCategoryType subCategoryType) { if (id != subCategoryType.SubCategoryTypeId) { return(StatusCode(StatusCodes.Status500InternalServerError, new Response { Status = "Error", Message = "This subcategory type id does not exist!" })); } _context.Entry(subCategoryType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SubCategoryTypeExists(id)) { return(StatusCode(StatusCodes.Status500InternalServerError, new Response { Status = "Error", Message = "This subcategory type id does not exist!" })); } else { throw; } } return(NoContent()); }
public void WhenISelectProductTypesSub_Category(SubCategoryType subCategoryType) { CreateNewProductPage createNewProduct = new CreateNewProductPage(Driver, _appSettings); createNewProduct.ClickAction(subCategoryType); Wait.Seconds(1); }
internal void ClickAction(SubCategoryType subCategoryType) { ElementLocatorExtensions.GetElementXpath(productTypeTitle, "bags").ClickButton(); Wait.Seconds(1); this.GetActionButton(subCategoryType).Click(); }
private By GetActionButton(SubCategoryType action) { return(By.XPath(string.Format(subCatImg, action.GetEnumDescription()))); }