diff --git a/Yavsc/Model/ApplicationDbContext.cs b/Yavsc/Model/ApplicationDbContext.cs index e0cd5194..02acf328 100644 --- a/Yavsc/Model/ApplicationDbContext.cs +++ b/Yavsc/Model/ApplicationDbContext.cs @@ -181,6 +181,6 @@ namespace Yavsc.Models public DbSet EstimateTemplates { get; set; } - + public DbSet Contacts { get; set; } } } diff --git a/Yavsc/Model/Relationship/Contact.cs b/Yavsc/Model/Relationship/Contact.cs index ac845e7d..0dea2092 100644 --- a/Yavsc/Model/Relationship/Contact.cs +++ b/Yavsc/Model/Relationship/Contact.cs @@ -12,7 +12,10 @@ namespace Yavsc.Models [Required()] public string OwnerId { get; set; } - [ForeignKeyAttribute("OwnerId"),JsonIgnore] + [ForeignKeyAttribute("OwnerId"),NotMapped] public virtual ApplicationUser Owner { get; set; } + + [ForeignKeyAttribute("UserId"),NotMapped] + public virtual ApplicationUser User { get; set; } } }