小编tom*_*mus的帖子

EntityFramework:如何从数据库加载对象列表?

我有两个实体:

public class Booking
{
    [Key]
    public int Id { get; set; }

    public int RoomId { get; set; }
    [ForeignKey("RoomId")]
    public Room Room { get; set; }

    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }

    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string DocumentNumber { get; set; }
    public string ContactPhone { get; set; }
}

public class Room
{
    [Key]
    public int RoomId { …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

entity-framework ×1