public List <PerfumeViewModel> GetPerfumeByProduct(int productId) { var query = (from t in _productQuantityRepository.FindAll() join pt in _perfumeRepository.FindAll() on t.PerfumeId equals pt.Id where t.ProductId == productId select pt).Distinct(); return(query.ProjectTo <PerfumeViewModel>().ToList()); }
public List <PerfumeViewModel> GetPerfumes() { return(_perfumeRepository.FindAll().ProjectTo <PerfumeViewModel>().ToList()); }