Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Companies
- {
- public int CompanyId { get; set; }
- public string Name { get; set; }
- public string Description { get; set; }
- public string Tel { get; set; }
- public string Logo { get; set; }
- public int? Owner { get; set; }
- public int? Address { get; set; }
- public int? Publish { get; set; }
- public ICollection<Cars> Cars { get; set; }
- }
- public partial class Cars
- {
- public int CarId { get; set; }
- public string Manufacturer { get; set; }
- public string Model { get; set; }
- public string Year { get; set; }
- public string Description { get; set; }
- public decimal? Price { get; set; }
- public int? CarCatId { get; set; }
- public int? CompanyId { get; set; }
- public int? CharacteristicId { get; set; }
- public ICollection<CarImages> CarImages { get; set; }
- }
- public partial class CarImages
- {
- public int CarImagesId { get; set; }
- public string Image { get; set; }
- public int? CarId { get; set; }
- public Cars Car { get; set; }
- }
- var compInfo = _context.Companies.SelectMany(cr => cr.Cars.SelectMany(i =>i.CarImages.Where(car => car.CarId == car.Car.CarId))).ToList();
- var compInfo2 = _context.Companies.Include(a => a.AddressNavigation).Include(cr =>cr.Cars.).FirstOrDefault(c => c.CompanyId == id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement