Ignore:
Timestamp:
09/18/22 18:09:53 (2 years ago)
Author:
Danilo <danilo.najkov@…>
Branches:
master
Parents:
49b0bbd
Message:

vip functionallity + menu fields + alergens filtering + google/fb login + email queueing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • resTools_backend/backend/Services/RestaurantService.cs

    r49b0bbd r13f1472  
    4545                        Title = x.Title,
    4646                        Description = x.Description,
    47                         Price = x.Price
     47                        Price = x.Price,
     48                        Alergens = x.Alergens,
     49                        Image = String.Format("data:image/png;base64,{0}", Convert.ToBase64String(x.Image)),
     50                        IsVipOnly = x.IsVipOnly
    4851                    }).ToList(),
    4952                    Reviews = x.Reviews.Select(x => new ReviewResponse()
     
    5558                        Title = x.Title,
    5659                        Username = x.User == null ? "Anonymous" : x.User.Email
    57                     }).ToList(),
    58                     AverageReview = x.Reviews.Count>0 ? x.Reviews.Select(x => x.Stars).Average() : 0
     60                    }).ToList()
    5961                })
    6062                .FirstOrDefaultAsync();
     63            var reviews = await _context.Reviews.ToListAsync();
     64            res.AverageReview = reviews.Select(x => x.Stars).Sum();
    6165            return res;
    6266        }
Note: See TracChangeset for help on using the changeset viewer.