public async Task <ActionResult <ReportDto> > CreateUser([FromBody] UserDto userDto) { var report = userDto.Adapt <User>(); this.context.Users.Add(report); await this.context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetReportById), new { id = report.Id }, report.Adapt <UserDto>())); }
public async Task UpdateAsync(UserDto update, CancellationToken cancellationToken) { var userModel = update.Adapt <ApplicationUser>(); var entity = await _userManager.FindByIdAsync(update.Id.ToString()); if (entity != null) { await _userManager.UpdateAsync(userModel); } }
public async Task CreateAsync(UserDto user, CancellationToken cancellationToken) { var userModel = user.Adapt <ApplicationUser>(); var entity = await _userManager.FindByIdAsync(user.Id.ToString()); if (entity == null) { var result = await _userManager.CreateAsync(userModel); } }
public IDataResult <List <Claim> > GetClaims(UserDto user) { return(new SuccessDataResult <List <Claim> >(UserManager.GetClaimsAsync(user.Adapt <AppUser>()).Result.ToList())); }