BotSharp/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.cs

29 lines
900 B
C#
Raw Normal View History

2023-09-03 22:43:50 +00:00
using BotSharp.Abstraction.Agents.Models;
using BotSharp.Abstraction.Conversations.Models;
2023-09-07 22:04:34 +00:00
using BotSharp.Abstraction.Users.Models;
2023-08-26 04:41:01 +00:00
2023-09-01 22:33:36 +00:00
namespace BotSharp.Plugin.MongoStorage.Repository;
2023-08-28 05:28:14 +00:00
2024-01-13 02:13:38 +00:00
public partial class MongoRepository : IBotSharpRepository
2023-08-26 04:41:01 +00:00
{
2023-08-28 05:28:14 +00:00
private readonly MongoDbContext _dc;
private readonly IServiceProvider _services;
private UpdateOptions _options;
2023-11-29 16:40:27 +00:00
public MongoRepository(MongoDbContext dc, IServiceProvider services)
2023-08-26 04:41:01 +00:00
{
2023-08-28 05:28:14 +00:00
_dc = dc;
_services = services;
_options = new UpdateOptions
2023-08-26 04:41:01 +00:00
{
2023-08-28 05:28:14 +00:00
IsUpsert = true,
};
}
2023-08-26 04:41:01 +00:00
2023-10-17 20:29:40 +00:00
private List<Agent> _agents = new List<Agent>();
private List<User> _users = new List<User>();
private List<UserAgent> _userAgents = new List<UserAgent>();
private List<Conversation> _conversations = new List<Conversation>();
2024-01-13 02:13:38 +00:00
List<string> _changedTableNames = new List<string>();
2023-08-26 04:41:01 +00:00
}