Ejemplo n.º 1
0
 public void Create(User user, string password)
 {
     IdentityResult addUserResult = _userManager.Create(user, password);
     if (!addUserResult.Succeeded)
     {
         foreach (var error in addUserResult.Errors)
             new DomainNotification("AssertArgumentLength", error);
     }
 }
        public User Create(CreateUserCommand commandUser)
        {
            var user = new User(commandUser.IdPerson, commandUser.Email, commandUser.UserName);
            user.Validate();
            _repository.Create(user, "C@achinP1an");

            if (Commit())
                return user;

            return null;
        }
Ejemplo n.º 3
0
        public void Delete(User user)
        {
            _context.Person.Remove(user.Person);

            IdentityResult deleteUserResult = _userManager.Delete(user);
            if (!deleteUserResult.Succeeded)
            {
                foreach (var error in deleteUserResult.Errors)
                    new DomainNotification("AssertArgumentLength", error);
            }
        }
 public CreateSessionCommand(CoachingProcess coachingProcess, string theme, User user, DateTime date, TimeSpan startTime, TimeSpan? endTime, ESessionClassification classification, string observation, ICollection<Job> job)
 {
     this.Theme = theme;
     this.Date = date;
     this.StartTime = startTime;
     this.EndTime = endTime;
     this.Classification = classification;
     this.CoachingProcess = coachingProcess;
     this.User = user;
     this.Observation = observation;
     this.Job = job;
 }
 public UpdateSessionCommand(Guid id, CoachingProcess coachingProcess, string theme, User user, DateTime date, TimeSpan startTime, TimeSpan? endTime, ESessionClassification classification, string observation, ICollection<Job> job,ICollection<EvaluationCoach> coach, ICollection<EvaluationCoachee> coachee)
 {
     this.Id = id;
     this.Theme = theme;
     this.Date = date;
     this.StartTime = startTime;
     this.EndTime = endTime;
     this.Classification = classification;
     this.CoachingProcess = coachingProcess;
     this.User = user;
     this.Observation = observation;
     this.Job = job;
     this.Coach = coach;
     this.Coachee = coachee;
 }
Ejemplo n.º 6
0
 public void ChangeUser(User user)
 {
     this.User = user;
     this.IdUser = user.Id;
 }
 public ClaimsIdentity GenerateUserIdentityAsync(User user, string authenticationType)
 {
     return _repository.GenerateUserIdentityAsync(user, authenticationType);
 }
Ejemplo n.º 8
0
 public ClaimsIdentity GenerateUserIdentityAsync(User user, string authenticationType)
 {
     var userIdentity = _userManager.CreateIdentity(user, authenticationType);
     return userIdentity;
 }
Ejemplo n.º 9
0
 public void Update(User user, string newPassword)
 {
     _userManager.RemovePassword(user.Id);
     _userManager.AddPassword(user.Id, newPassword);
     _userManager.UpdateAsync(user);
 }
Ejemplo n.º 10
0
 public void Update(User user)
 {
     _userManager.UpdateAsync(user);
 }