示例#1
0
        public Task <T> Update(T entity)
        {
            ValidarEntidadNula <T> .IsNullEntity(entity);

            _entities.Attach(entity);
            _entities.Update(entity);
            return(Task.FromResult(entity));
        }
示例#2
0
        public Task <bool> DeleteAsync(T entity)
        {
            ValidarEntidadNula <T> .IsNullEntity(entity);

            _entities.Attach(entity);
            _entities.Remove(entity);
            return(Task.FromResult(true));
        }
示例#3
0
        public async Task <T> AddAsync(T entity)
        {
            ValidarEntidadNula <T> .IsNullEntity(entity);

            await _entities.AddAsync(entity).ConfigureAwait(false);

            return(entity);
        }