public WasteContainerUpdateModel GetWasteContainerAsEditModel(Guid id) { var entity = _repository.Get(id); if (entity == null) { throw new Exception(LOCALIZATION_ENTITY_NOT_FOUND); } return(WasteContainerMapper.MapToWasteContainerEditModel(entity)); }
public List <WasteContainerViewModel> GetWasteContainers() { var entities = _repository.GetAll(); if (entities == null) { throw new Exception(LOCALIZATION_ENTITY_NOT_FOUND); } return(WasteContainerMapper.MapToWasteContainerViewModel(entities)); }
public List <WasteContainerViewModel> GetWasteContainers(string columnName, string searchString) { List <WasteContainerDtoModel> entities; switch (columnName.ToLower()) { case "name": entities = _repository.GetByWasteContainerName(searchString); break; default: entities = _repository.GetAll(); break; } if (entities == null) { throw new Exception(LOCALIZATION_ENTITY_NOT_FOUND); } return(WasteContainerMapper.MapToWasteContainerViewModel(entities)); }