public BaseOutput SetAppProjectInfo([FromBody] SetAppProjectInfoInput input) { var model = _mapper.Map <SetAppProjectInfoInput, AppNamespaceModel>(input); if (model.Id > 0) { // 基础字段不容许更新 model.LastTime = DateTime.Now; model.LastUid = Convert.ToInt64(_user.Id); _adminDbContext.Updateable(model) .IgnoreColumns(it => new { it.CreateUid, it.CreateTime }) .ExecuteCommand(); } else { model.CreateTime = DateTime.Now; model.CreateUid = Convert.ToInt64(_user.Id); model.LastTime = DateTime.Now; model.LastUid = model.CreateUid; _adminDbContext.Insertable(model) .ExecuteCommand(); } return(new BaseOutput { }); }
public async Task <SetAppProjectInfoOutput> SetAppProjectInfo(SetAppProjectInfoInput input) { var model = _mapper.Map <SetAppProjectInfoInput, AppNamespaceInfo>(input); if (model.Id > 0) { // 基础字段不容许更新 model.LastTime = DateTime.Now; model.LastUid = Convert.ToInt64(_user.Id); await _dbContext.Updateable(model) .IgnoreColumns(it => new { it.CreateUid, it.CreateTime }) .ExecuteCommandAsync(); } else { model.CreateTime = DateTime.Now; model.CreateUid = Convert.ToInt64(_user.Id); model.LastTime = DateTime.Now; model.LastUid = model.CreateUid; await _dbContext.Insertable(model) .ExecuteCommandAsync(); } return(new SetAppProjectInfoOutput { }); }
public async Task <SetAppProjectInfoOutput> SetAppProjectInfo([FromBody] SetAppProjectInfoInput input) { return(await _configBusniess.SetAppProjectInfo(input)); }