ef-fluent-api

    0熱度

    1回答

    我有一個用戶實體在我的DbContext。我想要的是用戶應該能夠給對方提供參考/留下評論,因此我創建了參考實體。 public class Reference { public virtual User By { get; set; } // user who leaves a reference public virtual User To { get; set; } /

    -2熱度

    1回答

    我有一個問題。我有兩個類,我在實體框架中使用。 第一個是一個人類: 用int id,字符串名稱和動作創建(包括外鍵)。 第二個是行動課。 帶ID,時間和人(包括外鍵)。 當我嘗試遷移這個時,我得到一個錯誤,我應該使用Fluent Api來創建它之間的關係。 我搜索了一下,但它接近是我無法找到有關信息的情況。 public class Person { [Key] public

    0熱度

    1回答

    我試圖在實體框架中實現一些連接表,但我真的不能得到任何結果。 我有兩個主要目的: public class Device { [Key] public int Id { get; set; } public virtual ICollection<Connection> Slaves { get; set; } } public class Connecti

    0熱度

    1回答

    我會嘗試使用EF和Fluent API創建一對一關係。 第一類: public class Game { public int Id { get; set; } public Guid Token { get; set; } public string Player { get; set; } public virtual Field Field { ge

    1熱度

    2回答

    我有以下型號: public class ApplicationUser : IdentityUser { public int? StudentId { get; set; } public virtual Student Student { get; set; } } public class Student : BaseEntity { public

    0熱度

    1回答

    我要地圖我的實體之間的關係是這樣的: public partial class Profile { [Key] public int ProfileId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public st

    1熱度

    1回答

    我有我的實體框架POCO類的兩個對象稱爲救生艇和瞄準 瞄準有1間.. *救生艇的關係,這似乎工作罰款(與SightingLifeboats 的鏈接表我現在還需要備份參考這種關係,所以我需要從救生艇到瞄準一個鏈接,這將是0 .. * 我試圖做反向,並試圖使一個虛擬,但這沒有奏效,也許我需要更流利的編碼? 我救生艇類: public class Lifeboat : EntityBase {

    0熱度

    1回答

    複合鍵接表我有2個實體: //Product (all properties is the composite key) public string Id {get; set;} public string CompanyName {get; set;} //ProductDescriptions (All properties is the composite k

    0熱度

    1回答

    我在應用程序中有以下實體。 Student Parent (This Parent can be Father/Guardian) Address 他們有以下類定義。 public Class Student { public int StudentId {get; set;} //Addresses public Address TemporaryAdd

    1熱度

    1回答

    如何配置一端爲零或一端爲一端。例如: public class Student{ public int Id {get; set;} public Registration Registration {get; set;} } public class Registration{ public int Id {get; set;} //public i