public RoleSettingDto GetRolesetting(Guid id) { ExHelper.ThrowIf(id == Guid.Empty, "无效的查询参数"); RoleSettingDto dto = Dbc.Db.GetById <RoleSettingDto>(id); return(dto); }
private bool SetRolesetting(RoleSettingDto dto) { CheckRolesetting(dto);//检查用户输入 if (dto.Id != Guid.Empty) { RoleSettingDto dbDto = Dbc.Db.GetById <RoleSettingDto>(dto.Id); ExHelper.ThrowIfNull(dbDto, "查找更新记录失败."); dbDto.CopyTo(dto, a => a.Id); } Dbc.Db.Set(dto); return(true); }
/// <summary> /// 检查校验Save对象 /// </summary> /// <param name="dto">Dto 对象</param> /// <returns></returns> private void CheckRolesetting(RoleSettingDto dto) { }
/// <summary> /// 数据插入或更新 /// </summary> /// <param name="dto"></param> /// <returns></returns> public RoleSettingDto InsertOrUpdate(RoleSettingDto dto) { return(_repository.InsertOrUpdate(dto)); }