public virtual TEntity Insert(TEntity entity)
        {
            if (entity.GetType().GetProperty("StatusID") != null)
            {
                entity.GetType().GetProperty("StatusID").SetValue(entity, 1);
            }

            if (entity.GetType().GetProperty("CreatedDate") != null)
            {
                entity.GetType().GetProperty("CreatedDate").SetValue(entity, DateTime.Now);
            }

            var result = _context.Set <TEntity>().Add(entity);

            return(result);
        }
 public IQueryable <TEntity> GetAll()
 {
     try
     {
         return(_context.Set <TEntity>());
     }
     catch (Exception)
     {
         throw new Exception("Couldn't retrieve entities");
     }
 }