コード例 #1
0
        public List <BuildStandart> Read(int minId = Constants.DefIntVal, int maxId = Constants.DefIntVal, int minServiceId = Constants.DefIntVal, int maxServiceId = Constants.DefIntVal, int minComponetId = Constants.DefIntVal, int maxComponetId = Constants.DefIntVal)
        {
            List <ServiceComponent> serviceComponents = _mapper.Map <List <СomponetServiceEntity>, List <ServiceComponent> >(_repository.Read(minId, maxId, minServiceId, maxServiceId, minComponetId, maxComponetId));
            List <BuildStandart>    result            = new List <BuildStandart>(serviceComponents.Count);

            int length = serviceComponents.Count;

            for (int i = 0; i < length; i++)
            {
                result.Add(new BuildStandart());
                result[i].Id       = serviceComponents[i].Id;
                result[i].Componet = _componetServices.Read(minId: serviceComponents[i].ComponetId, maxId: serviceComponents[i].ComponetId).FirstOrDefault();
                result[i].Service  = _serviceServices.Read(MinId: serviceComponents[i].ServiceId, MaxId: serviceComponents[i].ServiceId).FirstOrDefault();
            }

            return(result);
        }
コード例 #2
0
        public ActionResult ServicesList()
        {
            List <Service> services = _serviceServices.Read();

            return(View(services));
        }