public async Task <int> DeleteRolesAsync(Guid id) { var data = await _dal.QueryAsync(id); if (data == null) { return(-2); } else { return(await _dal.DeleteAsync(data)); } }
public async Task <int> EditRolesAsync(Guid id, string title) { var data = await _dal.QueryAsync(id); if (data == null) { return(-2);//-2代表数据不存在 } else { data.Title = title; data.UpdateTime = DateTime.Now; return(await _dal.EditAsync(data)); } }