public async Task PostUser([FromBody] UserCreatingModel userModel) { await _usersService.CreateAsync(userModel, _userManager); var tags = _tagsService.CreateOrGet(userModel.Tags); var user = _usersService.GetByUsername(userModel.Username); _usersService.CreateRelations(user, tags); }
public async Task CreateAsync(UserCreatingModel model, UserManager <User> userManager) { var user = User.Create(model.Username, model.Name, model.Email, model.Location, null); // Add the user to the Db with the choosen password await userManager.CreateAsync(user, model.Password); await userManager.AddToRoleAsync(user, "RegisteredUser"); _databaseContext.SaveChanges(); }
public static User Create(UserCreatingModel userModel, List <UserTag> tagsList) { //add eventlist and achivementlist var instance = new User { Id = Guid.NewGuid().ToString() }; instance.Update(userModel.Username, userModel.Name, userModel.Email, userModel.Location, tagsList); return(instance); }
public void Update(UserCreatingModel userModel, Guid id) { var user = GetById(id); List <UserTag> userTags = new List <UserTag>(); foreach (var tag in userModel.Tags) { userTags.Add(new UserTag(user.Id, user, tag.Label, Tag.Create(tag.Label))); } user.Update(userModel.Username, userModel.Name, userModel.Email, userModel.Location, userTags); _databaseContext.Users.Update(user); }
public void UpdateUser([FromBody] UserCreatingModel userModel, [FromRoute] Guid id) { _usersService.Update(userModel, id); }
public void Create(UserCreatingModel entity) { throw new NotImplementedException(); }
public async Task CreateAsync(UserCreatingModel model, UserManager <User> userManager) { await _usersRepository.CreateAsync(model, userManager); }
public void Update(UserCreatingModel userModel, Guid Id) { _usersRepository.Update(userModel, Id); }
public void Create(UserCreatingModel userModel) { _usersRepository.Create(userModel); }