using Diligent.WebAPI.Business.Interfaces; using Diligent.WebAPI.Data; using MongoDB.Driver; namespace Diligent.WebAPI.Business.Services { public class BaseRepository : IBaseRepository where TEntity : class { protected readonly IMongoDBContext _mongoContext; protected IMongoCollection _dbCollection; public BaseRepository(IMongoDBContext context) { _mongoContext = context; _dbCollection = _mongoContext.GetCollection(typeof(TEntity).Name); } public Task CreateAsync(TEntity entity) { throw new NotImplementedException(); } public async Task> GetAsync() { var all = await _dbCollection.FindAsync(Builders.Filter.Empty); return await all.ToListAsync(); } public Task GetByIdAsync(string id) { throw new NotImplementedException(); } public Task RemoveAsync(string id) { throw new NotImplementedException(); } public Task UpdateAsync(string id, TEntity updateEntity) { throw new NotImplementedException(); } } }