Пример #1
0
 public static bool CreateSectorCompanyScopeIsValid(this SectorCompany sector)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotEmpty(sector.Sector, "O setor é obrigatório")
            ));
 }
Пример #2
0
 public static bool UpdateSectorCompanyScopeIsValid(this SectorCompany sector, UpdateSectorCompanyCommand command)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotEmpty(command.Sector, "O setor é obrigatório")
            ));
 }
Пример #3
0
        public SectorCompany Create(CreateSectorCompanyCommand command)
        {
            var sector = new SectorCompany(command.Sector);

            sector.Create();
            _repository.Create(sector);

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

            return(null);
        }
 public void Delete(SectorCompany sector)
 {
     throw new NotImplementedException();
 }
 public void Update(SectorCompany sector)
 {
     _context.Entry <SectorCompany>(sector).State = System.Data.Entity.EntityState.Modified;
 }
 public void Create(SectorCompany sector)
 {
     _context.SectorCompany.Add(sector);
 }