You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#region RemovingRelationships
using (var context = new BloggingContext())
{
var blog = context.Blogs.Include(b => b.Posts).First();
**var post = blog.Posts.AsQueryable().First();**
blog.Posts.Remove(post);
context.SaveChanges();
}
#endregion
Document details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 0f0fb981-4dec-7ff7-817b-6606f620b875
Version Independent ID: c7517e7d-f011-a24c-53da-913771913998
The line below without
AsQueryable()
also works.Is
AsQueryable()
optonal in the code below?Document details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: