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

"The destination column could not be found" on collection types #535

Closed
burakt91 opened this issue Oct 12, 2019 · 1 comment
Closed

"The destination column could not be found" on collection types #535

burakt91 opened this issue Oct 12, 2019 · 1 comment
Assignees

Comments

@burakt91
Copy link

burakt91 commented Oct 12, 2019

Hi.
When I try this simple code, I'm getting this error: "The destination column could not be found:Categories".

db.Posts.Include("Categories")
.Where(p => p.ID == 1)
.Update(p => new Post()
{
  Categories = Enumerable.Range(5, 3).Select(i =>
               new PostCategory() { ID = i })
               .ToList()
});

I'm using EF6. And the other classes are like these:

public class Post
{
  public int ID { get; set; }
  public string Title { get; set; }
  public virtual ICollection<PostCategory> Categories { get; set; }
}
public class PostCategory
{
  public int ID { get; set; }
  public string Name { get; set; }
  public virtual ICollection<Post> Posts { get; set; }
}

I'm just trying delete a Post's existing categories and replacing them with new ones by giving new category ID's.
I also readed these:
#315
#238
Can you please help?

@JonathanMagnan JonathanMagnan self-assigned this Oct 14, 2019
@JonathanMagnan
Copy link
Member

Hello @burak-tarhanli ,

What you currently trying to do is simply not supported by our library. You could update column from Post table but you cannot delete and insert a list of new/existing categories (related table).

If you wish to make some operation in Bulk, I suggest our paid libraries: EF Extensions. We will be happy to help you make it works.

Best Regards,

Jonathan


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants