public static bool CreatePhoneCompanyScopeIsValid(this PhoneCompany phoneCompany) { return(AssertionConcern.IsSatisfiedBy ( AssertionConcern.AssertNotEmpty(phoneCompany.Number, "O Número é obrigatório") )); }
public static bool UpdatePhoneCompanyScopeIsValid(this PhoneCompany phoneCompany, UpdatePhoneCompanyCommand command) { return(AssertionConcern.IsSatisfiedBy ( AssertionConcern.AssertNotEmpty(command.Number, "O Número é obrigatório") )); }
public PhoneCompany Create(CreatePhoneCompanyCommand command) { var phone = new PhoneCompany(command.Number, command.IdCompany); phone.Create(); _repository.Create(phone); if (Commit()) { return(phone); } return(null); }
public void Create(PhoneCompany phone) { _context.PhoneCompany.Add(phone); }
public void Delete(PhoneCompany phone) { _context.PhoneCompany.Remove(phone); }
public void Update(PhoneCompany phone) { _context.Entry <PhoneCompany>(phone).State = System.Data.Entity.EntityState.Modified; }