خرید بک لینک

Vote count: 0

I am having some hard time to get data from Detail table, but I can get data back from the DetailKey table. This is what I have done so far and thank you for any help.

public class DetailKey
{
    public int Id { get; set; }
    public string System { get; set; }
    public string KeyValue { get; set; }
    public Nullable<int> DetailId { get; set; }
}

public class Detail
{
    public Detail()
    {
        this.DetailKeys = new HashSet<DetailKey>();
    }

    public int Id { get; set; }
    public System.DateTimeOffset CreatedDatetime { get; set; }
    public System.DateTimeOffset UpdatedDatetime { get; set; }
    public string Name { get; set; }
    public string FirstName { get; set; }
    public string MiddleName { get; set; }
    public string LastName { get; set; }
    public DateTime BirthDate { get; set; }
    public virtual ICollection<DetailKey> DetailKeys { get; set; }
}

public class MyDbContext : DbContext
{
     public MyDbContext() :base("name=dbCoectionString"){}

     public DbSet<Detail> Details {get; set;}
     public DbSet<DetailKey> DetailKeys {get; set;}
}

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 29 خرداد 1395 ساعت: 13:21

صفحه بندی