Example #1
0
 public static bool CreateCoacheeScopeIsValid(this Coachee coachee)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(coachee.Profession, Errors.InvalidProfession),
                AssertionConcern.AssertArgumentLength(coachee.Profession, 2, 25, Errors.InvalidProfession)
                ));
 }
Example #2
0
 public static bool ChangeProfessionScopeIsValid(this Coachee coachee, string profession)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(profession, Errors.InvalidProfession),
                AssertionConcern.AssertArgumentLength(profession, 2, 25, Errors.InvalidProfession)
                ));
 }
        public Coachee Create(CreateCoacheeCommand command)
        {
            var Coachee = new Coachee(command.Profession, command.IdUser, command.Weakness, command.StrongPoint, command.CoachingProcess);

            Coachee.Validate();
            _repository.Create(Coachee);

            if (Commit())
            {
                return(Coachee);
            }

            return(null);
        }
Example #4
0
 public void Update(Coachee coachee)
 {
     _context.Entry <Coachee>(coachee).State = System.Data.Entity.EntityState.Modified;
 }
Example #5
0
 public void Delete(Coachee coachee)
 {
     _context.Coachee.Remove(coachee);
 }
Example #6
0
 public void Create(Coachee coachee)
 {
     _context.Coachee.Add(coachee);
 }