Ejemplo n.º 1
0
        public virtual void Update(Entity entity, int id)
        {
            entity.Build(_context);
            Entity old = Get(id);

            ValidateUpdate(entity, id);
            _context.Entry(old).CurrentValues.SetValues(entity);
            old.Update(entity);
        }
Ejemplo n.º 2
0
        public virtual void Update(T entity, K Id)
        {
            Utility.Log($"REPOSOTORY: Update data.", "INFO");
            T old = Get(Id);

            if (old != null)
            {
                context.Entry(old).CurrentValues.SetValues(entity);
            }
        }
Ejemplo n.º 3
0
        public void Update(T entity, I id)
        {
            T old = Get(id);

            if (old != null)
            {
                timeKeeperContext.Entry(old).CurrentValues.SetValues(entity);
                Logger.Log("REPOSITORY: record updated", "INFO");
            }
            else
            {
                Logger.Log("REPOSITORY: record not found", "ERROR");
            }
        }