I use "AspIdentity" in the project. In project all standard models of "AspIdentity" and one model "Post". I would like each post to have its ApplicationUser and each ApplicationUser have its own collection of posts. And already have one database in which there is a table that stores information about users.
I tried to create tables, data context and database independently, but I don't find any information but I didn't find information about the case close to mine.
Post model:
public class Post
{
public int Id { get; set; }
public string Body { get; set; }
public string ApplicationUserId { get; set; }
public ApplicationUser ApplicationUser { get; set; }
}
ApplicationUser model:
public class ApplicationUser : IdentityUser
{
public int Year { get; set; }
public virtual ICollection<Post> Posts { get; set; }
public ApplicationUser()
{
Posts = new List<Post>();
}
}
I expect to see a data context in the response and a query with which to create a table of posts.