public async Task <IActionResult> PostMstCategoryAttribute([FromBody] MstCategoryAttribute mstCategoryAttribute) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstCategoryAttribute.Add(mstCategoryAttribute); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstCategoryAttribute", new { id = mstCategoryAttribute.CatAttributeId }, mstCategoryAttribute)); }
public async Task <IActionResult> PutMstCategoryAttribute([FromRoute] int id, [FromBody] MstCategoryAttribute mstCategoryAttribute) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstCategoryAttribute.CatAttributeId) { return(BadRequest()); } _context.Entry(mstCategoryAttribute).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstCategoryAttributeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }