public async Task <IActionResult> PostMstCategoryAttributeDataType([FromBody] MstCategoryAttributeDataType mstCategoryAttributeDataType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstCategoryAttributeDataType.Add(mstCategoryAttributeDataType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstCategoryAttributeDataType", new { id = mstCategoryAttributeDataType.CatAttributeDataTypeId }, mstCategoryAttributeDataType)); }
public async Task <IActionResult> PutMstCategoryAttributeDataType([FromRoute] int id, [FromBody] MstCategoryAttributeDataType mstCategoryAttributeDataType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstCategoryAttributeDataType.CatAttributeDataTypeId) { return(BadRequest()); } _context.Entry(mstCategoryAttributeDataType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstCategoryAttributeDataTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }