public static MongoDBFakeMQProcess Wrap(FakeMQProcess process) { return(new MongoDBFakeMQProcess { HandlerType = process.HandlerType, LastHandleTime = process.LastHandleTime, }); }
public void Add(FakeMQProcess process) { if (db.Processes.AsQueryable().Any(_ => _.HandlerType == process.HandlerType)) { return; } db.Processes.InsertOne(MongoDBFakeMQProcess.Wrap(process)); }
/// <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(); }
/// <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(); }