Exemple #1
0
        public virtual async Task <TEntity> UpdateAsync(TEntity entity)
        {
            FunctionCore.SetValueObjectProperty(entity, "UpdtDate", DateTime.Now);
            _context.Entry(entity).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(entity);
        }
Exemple #2
0
        public virtual async Task <TEntity> AddAsync(TEntity entity)
        {
            FunctionCore.SetValueObjectProperty(entity, "CreateDate", DateTime.Now);
            var dbEntityEntry = _context.Entry(entity);
            await _dbSet.AddAsync(entity);

            await _context.SaveChangesAsync();

            return(entity);
        }