public SoilPropertyDTO getSoilPropertyById(int id) { var query = from s in db.Geology_SoilProperties where s.ID == id select s; var item = query.FirstOrDefault(); SoilPropertyDTO res = Mapper.Map <SoilPropertyDTO>(item); res.StaticProp = Mapper.Map <SoilStaticPropertyDTO>(item); res.DynamicProp = Mapper.Map <SoilDynamicPropertyDTO>(item); return(res); }
public List <SoilPropertyDTO> getAllSoilProperty() { var query = from s in db.Geology_SoilProperties select s; var item = query.ToList(); List <SoilPropertyDTO> res = new List <SoilPropertyDTO>(); foreach (var i in item) { SoilPropertyDTO tmp = Mapper.Map <SoilPropertyDTO>(i); tmp.StaticProp = Mapper.Map <SoilStaticPropertyDTO>(i); tmp.DynamicProp = Mapper.Map <SoilDynamicPropertyDTO>(i); res.Add(tmp); } return(res); }
public List <SoilPropertyDTO> getSoilPropertyByProject(string project) { List <SoilProperty> sps = getAllByProject <SoilProperty>(project); return(SoilPropertyDTO.transferList(sps)); }