예제 #1
0
 public static MongoDBFakeMQProcess Wrap(FakeMQProcess process)
 {
     return(new MongoDBFakeMQProcess
     {
         HandlerType = process.HandlerType,
         LastHandleTime = process.LastHandleTime,
     });
 }
예제 #2
0
 public void Add(FakeMQProcess process)
 {
     if (db.Processes.AsQueryable().Any(_ => _.HandlerType == process.HandlerType))
     {
         return;
     }
     db.Processes.InsertOne(MongoDBFakeMQProcess.Wrap(process));
 }
예제 #3
0
 /// <inheritdoc />
 public void Add(FakeMQProcess process)
 {
     using var context = new FakeMQDbContext(dbConnectionString);
     if (context.FakeMQProcesses.Any(_ => _.HandlerType == process.HandlerType))
     {
         return;
     }
     context.FakeMQProcesses.Add(process);
     context.SaveChanges();
 }
예제 #4
0
 /// <inheritdoc />
 public void Add(FakeMQProcess process)
 {
     using var context = FakeMQDbContext.GetContext(serviceProvider);
     if (context.FakeMQProcesses.Any(_ => _.HandlerType == process.HandlerType))
     {
         return;
     }
     context.FakeMQProcesses.Add(process);
     context.SaveChanges();
 }