I have the following code:
public class Hotel { public int ID { get;set } public IList<Photo> Photos { get;set; } //...other code } public class Photo { public int ID { get;set; } //...other fields } In the database, I have the following tables:
Photo: ID, Url, //.. other fields HotelPhoto:ID, PhotoID, HotelID Hotel:ID, Location, //..other fields with relationships between Hotel <--> HotelPhoto and HotelPhoto <--> Photo.
My question is: Can I configure somehow a mapping between Hotel class and Hotel table to get a list of Photo without creating a new class HotelPhoto? ( I want a list of photos, not a list of HotelPhoto from which to get my photos).
Somehow I want to access the Photo table from the Hotel class without any class HotelPhoto, knowing that the table HotelPhoto contains only the IDs of Hotel and Photo table.
Thanks in advance, Tamash