public DepotDTO GetById(int id) { var depot = depots.GetById(id)?.ToDTO(); AddCountryToDepot(depot); return(depot); }
DepotPivot IDepotService.GetDepotPivot(long id) { var item = depotRepository.GetById((int)id); DepotPivot depotsPivot = Mapper.Map <GES_Depot, DepotPivot>(item); return(depotsPivot); }
public List <DrugType> GetAssociatedDrugTypes(int id) { List <DrugType> result = new List <DrugType>(); Depot depot = _depotRepository.GetById(id); depot.DrugUnits.ForEach(drugUnit => { if (result.Count > 0 && !result.Any(r => r.DrugTypeID == drugUnit.DrugType.DrugTypeID)) { result.Add(drugUnit.DrugType); } if (result.Count == 0) { result.Add(drugUnit.DrugType); } }); return(result); }