Esempio n. 1
0
 public static bool CreatePhoneCompanyScopeIsValid(this PhoneCompany phoneCompany)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotEmpty(phoneCompany.Number, "O Número é obrigatório")
            ));
 }
Esempio n. 2
0
 public static bool UpdatePhoneCompanyScopeIsValid(this PhoneCompany phoneCompany, UpdatePhoneCompanyCommand command)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotEmpty(command.Number, "O Número é obrigatório")
            ));
 }
Esempio n. 3
0
        public PhoneCompany Create(CreatePhoneCompanyCommand command)
        {
            var phone = new PhoneCompany(command.Number, command.IdCompany);

            phone.Create();
            _repository.Create(phone);

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

            return(null);
        }
Esempio n. 4
0
 public void Create(PhoneCompany phone)
 {
     _context.PhoneCompany.Add(phone);
 }
Esempio n. 5
0
 public void Delete(PhoneCompany phone)
 {
     _context.PhoneCompany.Remove(phone);
 }
Esempio n. 6
0
 public void Update(PhoneCompany phone)
 {
     _context.Entry <PhoneCompany>(phone).State = System.Data.Entity.EntityState.Modified;
 }