public AchievementType?ChallengePosted(Guid userId) { var user = identityUnitOfWork.Get <User>(userId); user.PostedTasksQuantity++; var result = GetAddedBadge(user, $"Posted{user.PostedTasksQuantity}"); identityUnitOfWork.InsertOrUpdate(user); identityUnitOfWork.Commit(); return(result); }
public IdentityUser UpdateIdentityUser(IdentityUser identityUser) { Contract.NotNull <ArgumentNullException>(identityUser); var user = unitOfWork.Get <User>(identityUser.Id); mapper.Map(identityUser, user); var updatedUser = unitOfWork.InsertOrUpdate(user); unitOfWork.Commit(); return(mapper.Map <IdentityUser>(updatedUser)); }