Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] RevEng: Initialize skip collection navigations in ctor #26212

Merged
merged 2 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ protected virtual void GenerateConstructor(IEntityType entityType)
{
Check.NotNull(entityType, nameof(entityType));

var collectionNavigations = entityType.GetNavigations().Where(n => n.IsCollection).ToList();
var collectionNavigations = entityType.GetNavigations().Where(n => n.IsCollection)
.Cast<INavigationBase>()
.Concat(entityType.GetSkipNavigations().Where(n => n.IsCollection))
.ToList();
smitpatel marked this conversation as resolved.
Show resolved Hide resolved

if (collectionNavigations.Count > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2123,6 +2123,11 @@ namespace TestNamespace
{
public partial class Blog
{
public Blog()
{
Posts = new HashSet<Post>();
}

public int Id { get; set; }

public virtual ICollection<Post> Posts { get; set; }
Expand All @@ -2138,6 +2143,11 @@ namespace TestNamespace
{
public partial class Post
{
public Post()
{
Blogs = new HashSet<Blog>();
}

public int Id { get; set; }

public virtual ICollection<Blog> Blogs { get; set; }
Expand Down Expand Up @@ -2258,6 +2268,11 @@ namespace TestNamespace
{
public partial class Blog
{
public Blog()
{
Posts = new HashSet<Post>();
}

public int Id { get; set; }

public virtual ICollection<Post> Posts { get; set; }
Expand All @@ -2273,6 +2288,11 @@ namespace TestNamespace
{
public partial class Post
{
public Post()
{
Blogs = new HashSet<Blog>();
}

public string Id { get; set; }

public virtual ICollection<Blog> Blogs { get; set; }
Expand Down Expand Up @@ -2401,6 +2421,11 @@ namespace TestNamespace
{
public partial class Blog
{
public Blog()
{
Posts = new HashSet<Post>();
}

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

Expand All @@ -2422,6 +2447,11 @@ namespace TestNamespace
{
public partial class Post
{
public Post()
{
Blogs = new HashSet<Blog>();
}

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

Expand Down