using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CafeTerrace.Models.DataBase
{
    public class Food
    {
        public string FoodId { get; set; }

        public string Name { get; set; }
        public bool IsExist { get; set; }
        public DateTime Register { get; set; }
        public int TimeReady { get; set; }
        public string Description { get; set; }
        public float AverageRate { get; set; }
        public int Count { get; set; }
        public int Priority { get; set; }
        public bool ServiceNow { get; set; }
        public bool ChefSuggestion { get; set; }
        public bool IsFavorite { get; set; }

        public Price Price { get; set; }
        public FoodImage FoodImages { get; set; }
        public virtual ICollection<FoodImage> FoodPhoto { get; set; }
        public virtual ICollection<FoodType> FoodType { get; set; }
        public virtual ICollection<Favorite> Favorites { get; set; }
        public virtual ICollection<FoodCategory> FoodCategories { get; set; }
        public virtual ICollection<OrderFood> OrderFoods { get; set; }
        public virtual ICollection<Rate> Rates { get; set; }


        public int RatesCount
        {
            get
            {
                return Rates.Count;
            }
        }

        public FoodImage GetSingleFoodPhoto
        {
            get
            {
                if (FoodImages != null)
                    return FoodImages;
                if (FoodPhoto != null)
                    return FoodPhoto.FirstOrDefault();
                else
                    return null;
            }
        }





    }
}
