//start cate_kind public async Task <bool> AddCateKind(CateKind entity) { _dbContext.Cate_Kinds.Add(entity); try { await _dbContext.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }
public async Task <bool> UpdateCateKind(CateKind entity) { var item = await _dbContext.Cate_Kinds.FirstOrDefaultAsync(x => x.ID == entity.ID); item.Cate_Kind_Name = entity.Cate_Kind_Name; try { await _dbContext.SaveChangesAsync(); return(true); } catch (Exception ex) { var message = ex.Message; //logging return(false); } }
public async Task <IActionResult> UpdateCateKind([FromBody] CateKind entity) { return(Ok(await _categoryService.UpdateCateKind(entity))); }