public async Task <bool> UpdateAsync(SnVideoType Entity) { _coreDbContext.SnVideoType.Update(Entity); return(await _coreDbContext.SaveChangesAsync() > 0); }
[Authorize(Roles = "kai")] //角色授权 public async Task <IActionResult> UpdateAsync(SnVideoType Entity) { return(Ok(await _service.UpdateAsync(Entity))); }
/// <summary> /// 添加数据 /// </summary> /// <param name="Entity"></param> /// <returns></returns> public async Task <bool> AddAsync(SnVideoType Entity) { await _coreDbContext.SnVideoType.AddAsync(Entity); return(await _coreDbContext.SaveChangesAsync() > 0); }