BaseWorkStationService.cs 1007 Bytes
using HHECS.Application.Service;
using HHECS.BllModel;
using HHECS.DAL.Repository;
using HHECS.Model.Entities;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace HHECS.BLL.Services
{
    public class BaseWorkStationService : BaseService
    {
        [ThreadStatic]
        private readonly BaseWorkStationRepository _baseWorkStationRepository;

        public BaseWorkStationService()
        {
            _baseWorkStationRepository = new BaseWorkStationRepository();
        }

        /// <summary>
        /// 获取所有工位数据
        /// </summary>
        /// <returns></returns>
        public List<BaseWorkStation> GetAll()
        {
            return _baseWorkStationRepository.Where(x => true).ToList();
        }

        public BllResult<List<BaseWorkStation>> GetWorkStations(Expression<Func<BaseWorkStation, bool>> exp)
        {
            return BllResultFactory.Success(_baseWorkStationRepository.Where(exp).ToList());
        }
    }
}