Skip to content
Omar Piani edited this page Mar 26, 2018 · 11 revisions

What is SharpRepository?

SharpRepository is a generic repository written in c# which includes support for various relational, document and object databases including Entity Framework, RavenDB, MongoDb and Db4o. #Repository includes Xml and InMemory repository implementations as well. #Repository offers built-in caching options for AppFabric, Memcache and standard System.Runtime.Caching. #Repository also supports Specifications, FetchStrategies, Batches and Traits.

New to SharpRepository? Check out the Getting Started page first.

Why use SharpRepository?

The Repository pattern is a facade that abstracts away the technical concerns of your persistence implementation by offering a collection-like interface for managing domain objects.

Following this pattern, SharpRepository is a persistent ignorant seam which sits between your application and data access layer. By offering the needed separation of concerns, SharpRepository offers the ability to unit test against mocks as opposed to integration testing against the database itself and SharpRepository provides numerous persistence implementations (EF, RavenDb, etc) which can be swapped based on project needs.

General Features

  • Entity Framework 6, Entity Framework Core 1 and 2, RavenDb, MongoDb, Db4o, Xml and InMemory Implementations
  • AppFabric, Memcached and System.Runtime.Caching Caching Options
  • Caching strategy implementations include Write-Through Caching, Generational Caching, as well as a simple Timeout Caching approach
  • Traits which promote Interface Segregation Principle (ISP)
  • Testable, DDD-style Specifications
  • Batching

Samples

The source code contains includes unit tests, integration tests and additional samples. To view, download the source code, open the SharpRepository.sln solution and review the following projects: SharpRepository.Samples, SharpRepository.Samples.MvcCore, SharpRepository.Samples.MVC5, SharpRepository.Tests.Integration and SharpRepository.Tests.