Ashutosh_Refactor #107

Merged
ashutosh.nehete merged 52 commits from Ashutosh_Refactor into main 2025-07-18 13:01:29 +00:00
Showing only changes of commit a64ce4fb02 - Show all commits

View File

@ -1,5 +1,4 @@
using Marco.Pms.DataAccess.Data; using Marco.Pms.Model.MongoDBModels;
using Marco.Pms.Model.MongoDBModels;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using MongoDB.Driver; using MongoDB.Driver;
@ -8,13 +7,10 @@ namespace Marco.Pms.CacheHelper
{ {
public class EmployeeCache public class EmployeeCache
{ {
private readonly ApplicationDbContext _context;
//private readonly IMongoDatabase _mongoDB;
private readonly IMongoCollection<EmployeePermissionMongoDB> _collection; private readonly IMongoCollection<EmployeePermissionMongoDB> _collection;
public EmployeeCache(ApplicationDbContext context, IConfiguration configuration) public EmployeeCache(IConfiguration configuration)
{ {
var connectionString = configuration["MongoDB:ConnectionString"]; var connectionString = configuration["MongoDB:ConnectionString"];
_context = context;
var mongoUrl = new MongoUrl(connectionString); var mongoUrl = new MongoUrl(connectionString);
var client = new MongoClient(mongoUrl); // Your MongoDB connection string var client = new MongoClient(mongoUrl); // Your MongoDB connection string
var mongoDB = client.GetDatabase(mongoUrl.DatabaseName); // Your MongoDB Database name var mongoDB = client.GetDatabase(mongoUrl.DatabaseName); // Your MongoDB Database name