Exemplo n.º 1
0
        public bool Remove(SectorEF entity)
        {
            if (entity is null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            return(Remove(entity.Id));
        }
Exemplo n.º 2
0
        public SectorEF Update(SectorEF Entity)
        {
            if (Entity is null)
            {
                throw new ArgumentNullException(nameof(Entity));
            }

            return(issuesContext
                   .Sectors
                   .Update(Entity)
                   .Entity
                   );
        }
Exemplo n.º 3
0
        public SectorEF Add(SectorEF Entity)
        {
            if (Entity is null)
            {
                throw new ArgumentNullException(nameof(Entity));
            }

            var sector = Entity;
            var result = issuesContext.Sectors.Add(sector);

            issuesContext.SaveChanges();
            return(result.Entity);
        }
Exemplo n.º 4
0
        public static SectorTO ToTransfertObject(this SectorEF issue)
        {
            if (issue is null)
            {
                throw new ArgumentNullException(nameof(issue));
            }

            return(new SectorTO
            {
                SectorId = issue.SectorId,
                Name = issue.Name
            });
        }