public async Task <ActionResponse <ClassLocationsDto> > GetById(int id) { try { var query = unitOfWork.GetGenericRepository <ClassLocations>() .ReadAll() .Where(e => e.Id == id); var entities = mapper.ProjectTo <ClassLocationsDto>(query).ToList(); await locationService.AttachLocations(entities); return(await ActionResponse <ClassLocationsDto> .ReturnSuccess(entities.Single())); } catch (Exception) { return(await ActionResponse <ClassLocationsDto> .ReturnError("Greška prilikom dohvata mjesta izvođenja.")); } }