public async Task <bool> AddAsync(SnTalk Entity) { await _coreDbContext.SnTalk.AddAsync(Entity); return(await _coreDbContext.SaveChangesAsync() > 0); }
public async Task <bool> UpdateAsync(SnTalk Entity) { _coreDbContext.SnTalk.Update(Entity); return(await _coreDbContext.SaveChangesAsync() > 0); }
[Authorize(Roles = "kai")] //角色授权 public async Task <IActionResult> AddAsync(SnTalk Entity) { return(Ok(await _service.AddAsync(Entity))); }