Пример #1
0
        public bool Delete(int id)
        {
            var entity = EntityTable.FirstOrDefault(LinqExpression(id));

            if (entity != null)
            {
                EntityTable.Remove(entity);
                SaveDb();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        public TEntity GetById(int id)
        {
            TEntity entity = EntityTable.FirstOrDefault(LinqExpression(id));

            return(entity);
        }
Пример #3
0
        public TEntity GetByExpression(Func <TEntity, bool> expression)
        {
            TEntity entity = EntityTable.FirstOrDefault(expression);

            return(entity);
        }