Skip to content

An Expremental project that brings Include and ThenInclude with with Filtering to MongoDb similar to EF Core.

License

Notifications You must be signed in to change notification settings

mjebrahimi/MongoDb.Include

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDb.Include

An Expremental project that brings Include and ThenInclude with with Filtering to MongoDb similar to EF Core.

Works in progress: not yet ready for production.

Demo:

public class Category
{
	public ObjectId Id { get; set; }
	public string Name { get; set; }
	
	[InverseProperty("CategoryId")]
	public ICollection Posts { get; set; }
}

public class Post
{
	public ObjectId Id { get; set; }
	public string Name { get; set; }
	public ObjectId CategoryId { get; set; }
	
	[ForeignKey("CategoryId")]
	public Category Category { get; set; }
}


var posts = postCollection
				.AsAggregateQueryable()
				.Include(p => p.Category)
				.ToList();

var categories = categoryCollection
				.AsAggregateQueryable()
				.Include(p => p.Posts)
				.ToList();

About

An Expremental project that brings Include and ThenInclude with with Filtering to MongoDb similar to EF Core.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages