示例#1
0
 public User GetUser(Expression <Func <User, bool> > condition)
 {
     using (var context = new DemoProjeDbContext())
     {
         return(context.User
                .Where(p => p.IsDeleted != true)
                .FirstOrDefault(condition));
     }
 }
示例#2
0
        public List <Maintenance> GetMaintenanceList(Expression <Func <Maintenance, bool> > condition = null)
        {
            using (var _context = new DemoProjeDbContext())
            {
                var list = condition == null?
                           _context.Set <Maintenance>().ToList() :
                               _context.Set <Maintenance>().Where(condition).ToList();

                return(list);
            }
        }
        public MaintenanceHistory GetMaintenanceHistory(Expression <Func <MaintenanceHistory, bool> > condition)
        {
            var result = new MaintenanceHistory();

            using (var context = new DemoProjeDbContext())
            {
                result = context.MaintenanceHistory
                         .Where(p => p.IsDeleted != true)
                         .FirstOrDefault(condition);
            }

            return(result);
        }
示例#4
0
        public Status GetStatus(Expression <Func <Status, bool> > condition)
        {
            var result = new Status();

            using (var context = new DemoProjeDbContext())
            {
                result = context.Status
                         .Where(p => p.IsDeleted != true)
                         .FirstOrDefault(condition);
            }

            return(result);
        }
示例#5
0
        public Vehicle GetVehicle(Expression <Func <Vehicle, bool> > condition)
        {
            var result = new Vehicle();

            using (var context = new DemoProjeDbContext())
            {
                result = context.Vehicle
                         .Where(p => p.IsDeleted != true)
                         .FirstOrDefault(condition);
            }

            return(result);
        }
示例#6
0
        public Maintenance GetMaintenance(Expression <Func <Maintenance, bool> > condition)
        {
            var result = new Maintenance();

            using (var context = new DemoProjeDbContext())
            {
                result = context.Maintenance
                         .Where(p => p.IsDeleted == false)
                         .FirstOrDefault(condition);
            }

            return(result);
        }
示例#7
0
        public PictureGroup GetPictureGroup(Expression <Func <PictureGroup, bool> > condition)
        {
            var result = new PictureGroup();

            using (var context = new DemoProjeDbContext())
            {
                result = context.PictureGroup
                         .Where(p => p.IsDeleted != true)
                         .FirstOrDefault(condition);
            }

            return(result);
        }
示例#8
0
        public ActionType GetActionType(Expression <Func <ActionType, bool> > condition)
        {
            var result = new ActionType();

            using (var context = new DemoProjeDbContext())
            {
                result = context.ActionType
                         .Where(p => p.IsDeleted != true)
                         .FirstOrDefault(condition);
            }

            return(result);
        }