示例#1
0
        public EffectiveTO Add(EffectiveTO Entity)
        {
            if (Entity is null)
            {
                throw new ArgumentNullException(nameof(Entity));
            }

            var effective = Entity.ToEF();

            return(financialContext.Effectives.Add(effective).Entity.ToTransfertObject());
        }
        public EffectiveTO Update(EffectiveTO Entity)
        {
            if (Entity is null)
            {
                throw new ArgumentNullException(nameof(Entity));
            }

            return(financialContext
                   .Effectives
                   .Update(Entity.ToEF())
                   .Entity
                   .ToTransferObject());
        }
        public EffectiveTO Add(EffectiveTO Entity)
        {
            if (Entity is null)
            {
                throw new ArgumentNullException(nameof(Entity));
            }

            var effective = Entity.ToEF();
            var result    = financialContext.Effectives.Add(effective);

            financialContext.SaveChanges();
            return(result.Entity.ToTransferObject());
        }