using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TourAgent.Views; namespace TourAgent.Models { public partial class Hotel { UP_SmirnovContext db = new UP_SmirnovContext(); public string CountryName { get { return db.Countries.Where(x => x.Code == CountryCode).Select(x=>x.Name).FirstOrDefault(); } } public int AmountTours { get { List HotelForAmount = db.HotelOfTours.ToList(); HotelForAmount = HotelForAmount.Where(x => x.HotelId == Id).ToList(); return HotelForAmount.Count; } } } }