У меня есть 2 класса, которые я определил в своем приложении. net Базовая структура сущности 3.1
Room и RoomTypes
publi c class Room {
public int RoomId { get; set; }
[StringLength(250)]
public string Roomname { get; set; }
[StringLength(450)]
public string RoomDescription { get; set; }
[StringLength(50)]
public string Rate { get; set; }
[StringLength(50)]
public string RateSpecial { get; set; }
public bool? Available { get; set; }
[StringLength(350)]
public string PhotoPath { get; set; }
public bool? Internet { get; set; }
public bool? TVSet { get; set; }
public bool? ElectronicSafe { get; set; }
public bool? TeaCoffee { get; set; }
public bool? Linnin { get; set; }
public int? RoomTypeId { get; set; }
public virtual RoomType RoomType { get; set; }
}
и RoomTypes
publi c class RoomType {
public int RoomTypeId { get; set; }
[Column("RoomType")]
[StringLength(90)]
public string RoomType1 { get; set; }
public virtual ICollection<Room> Rooms { get; set; }
}
Но когда я строю свои модели, в поле поиска (RoomType) отображается поле идентификатора, а не тип. Если в MVC 5 я точно так же создаю леса, он делает это правильно, и в поле поиска отображается тип, а не идентификатор.
Может кто-нибудь пролить свет на эту проблему ?? Спасибо Люк