Today I Learned: SharpRepository
17 Dec 2015
I absolutely forgot about the blog. My bad. Let’s add something interesting about C#.
SharpRepository is a generic repository written in C# which includes support for various relational, document and object databases including Entity Framework, RavenDB, MongoDB, CouchDB and Db4o. SharpRepository includes Xml and InMemory repository implementations as well. SharpRepository offers built-in caching options for AppFabric, memcached and the standard System.Runtime.Caching. SharpRepository also supports Specifications, FetchStrategies, Batches and Traits.
To install SharpRepository, run the following command in the Package Manager Console
All information about SharpRepository you can find on github
How to use Include() to include related entities?
One of the most interesting question was about Entity Framework and
Include functionality. For example, you have
And you need to get information about the
There are 2 general ways to query the repository:
- Use a predicate in query
- Use a
Specificationobject that holds predicate.
The equivalent of the EF Include statements are set in a
Specification object and called a