Beispiel #1
0
        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());
        }
Beispiel #2
0
 public List <PerfumeViewModel> GetPerfumes()
 {
     return(_perfumeRepository.FindAll().ProjectTo <PerfumeViewModel>().ToList());
 }