public int CreateUser(UserEntity user,string email) { if (unitOfWork.AuthorizationRepository.Get(x=>x.Email == email) == null) { unitOfWork.UserRepository.Create(user.ToDataTransferUser()); unitOfWork.Save(); var userId = unitOfWork.UserRepository.Get(x => x.UserName == user.UserName).Id; unitOfWork.AchievementRepository.Create(userId); return userId; } return 0; }
public void DeleteUser(UserEntity user) { unitOfWork.UserRepository.Delete(user.ToDataTransferUser()); unitOfWork.Save(); }