public async Task <UserGetListRp> PutUser(int id, UserPutRp model) { this._dbContext.ChangeTracker.AutoDetectChangesEnabled = true; var target = await this._dbContext.Users.Where(c => c.Id == id).SingleAsync(); target.Update(model.Email, model.Avatar, model.Name, model.SlackMember); this._dbContext.Users.Update(target); await this._dbContext.SaveChangesAsync(); return(this._mapper.Map <UserGetListRp>(target)); }
public async Task <IActionResult> Put(int id, [FromBody] UserPutRp model) { var result = await this._userComponent.PutUser(id, model); return(this.Ok(result)); }