Skip to content

Instantly share code, notes, and snippets.

@fasetto
Last active October 16, 2017 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fasetto/5f885e768e0f355a885c81193b64316c to your computer and use it in GitHub Desktop.
Save fasetto/5f885e768e0f355a885c81193b64316c to your computer and use it in GitHub Desktop.
public abstract class MongoRepository<TEntity> : IRepository<TEntity>
where TEntity : EntityBase
{
protected abstract IMongoCollection<TEntity> Collection { get; }
public MongoRepository(MongoDataContext dataContext)
{
}
public virtual async Task AddNewAsync(TEntity entity)
{
await Collection.InsertOneAsync(entity);
}
// [..]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment