Compare commits
No commits in common. "f406a15508656c302bba536b1204bec7ab940362" and "5369bbae297e424bf97e0f9faad274cf2c674727" have entirely different histories.
f406a15508
...
5369bbae29
@ -1,4 +1,5 @@
|
||||
using Marco.Pms.Model.MongoDBModels;
|
||||
using Marco.Pms.DataAccess.Data;
|
||||
using Marco.Pms.Model.MongoDBModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MongoDB.Driver;
|
||||
@ -7,10 +8,13 @@ namespace Marco.Pms.CacheHelper
|
||||
{
|
||||
public class EmployeeCache
|
||||
{
|
||||
private readonly ApplicationDbContext _context;
|
||||
//private readonly IMongoDatabase _mongoDB;
|
||||
private readonly IMongoCollection<EmployeePermissionMongoDB> _collection;
|
||||
public EmployeeCache(IConfiguration configuration)
|
||||
public EmployeeCache(ApplicationDbContext context, IConfiguration configuration)
|
||||
{
|
||||
var connectionString = configuration["MongoDB:ConnectionString"];
|
||||
_context = context;
|
||||
var mongoUrl = new MongoUrl(connectionString);
|
||||
var client = new MongoClient(mongoUrl); // Your MongoDB connection string
|
||||
var mongoDB = client.GetDatabase(mongoUrl.DatabaseName); // Your MongoDB Database name
|
||||
|
||||
@ -1184,11 +1184,7 @@ namespace Marco.Pms.Services.Helpers
|
||||
var emplyeeIds = employeeBucketMappings.Select(eb => eb.EmployeeId).ToList();
|
||||
List<ContactBucketMapping>? contactBuckets = contactBucketMappings.Where(cb => cb.BucketId == bucket.Id).ToList();
|
||||
AssignBucketVM bucketVM = bucket.ToAssignBucketVMFromBucket();
|
||||
if (bucketVM.CreatedBy != null)
|
||||
{
|
||||
emplyeeIds.Add(bucketVM.CreatedBy.Id);
|
||||
}
|
||||
bucketVM.EmployeeIds = emplyeeIds.Distinct().ToList();
|
||||
bucketVM.EmployeeIds = emplyeeIds;
|
||||
bucketVM.NumberOfContacts = contactBuckets.Count;
|
||||
bucketVMs.Add(bucketVM);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user