diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/AgentCollection.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/AgentCollection.cs index 4b92b87e..ff555750 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/AgentCollection.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/AgentCollection.cs @@ -15,7 +15,7 @@ public class AgentCollection : MongoBase public bool AllowRouting { get; set; } public bool Disabled { get; set; } public List Profiles { get; set; } - public List RoutingRules { get; set; } + public List RoutingRules { get; set; } public DateTime CreatedTime { get; set; } public DateTime UpdatedTime { get; set; } diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/RoutingRuleElement.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/RoutingRuleMongoElement.cs similarity index 76% rename from src/Plugins/BotSharp.Plugin.MongoStorage/Models/RoutingRuleElement.cs rename to src/Plugins/BotSharp.Plugin.MongoStorage/Models/RoutingRuleMongoElement.cs index bdb8e1be..c2144870 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/RoutingRuleElement.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/RoutingRuleMongoElement.cs @@ -2,20 +2,20 @@ using BotSharp.Abstraction.Routing.Models; namespace BotSharp.Plugin.MongoStorage.Models; -public class RoutingRuleElement +public class RoutingRuleMongoElement { public string Field { get; set; } public bool Required { get; set; } public Guid? RedirectTo { get; set; } - public RoutingRuleElement() + public RoutingRuleMongoElement() { } - public static RoutingRuleElement ToMongoElement(RoutingRule routingRule) + public static RoutingRuleMongoElement ToMongoElement(RoutingRule routingRule) { - return new RoutingRuleElement + return new RoutingRuleMongoElement { Field = routingRule.Field, Required = routingRule.Required, @@ -23,7 +23,7 @@ public class RoutingRuleElement }; } - public static RoutingRule ToDomainElement(string agentId, string agentName, RoutingRuleElement rule) + public static RoutingRule ToDomainElement(string agentId, string agentName, RoutingRuleMongoElement rule) { return new RoutingRule { diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.cs index e1616cce..0e919fcb 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.cs @@ -48,7 +48,7 @@ public class MongoRepository : IBotSharpRepository AllowRouting = x.AllowRouting, Profiles = x.Profiles, RoutingRules = x.RoutingRules? - .Select(r => RoutingRuleElement.ToDomainElement(x.Id.ToString(), x.Name, r))? + .Select(r => RoutingRuleMongoElement.ToDomainElement(x.Id.ToString(), x.Name, r))? .ToList() ?? new List(), CreatedDateTime = x.CreatedTime, UpdatedDateTime = x.UpdatedTime @@ -218,8 +218,8 @@ public class MongoRepository : IBotSharpRepository Disabled = x.Disabled, Profiles = x.Profiles, RoutingRules = x.RoutingRules? - .Select(r => RoutingRuleElement.ToMongoElement(r))? - .ToList() ?? new List(), + .Select(r => RoutingRuleMongoElement.ToMongoElement(r))? + .ToList() ?? new List(), CreatedTime = x.CreatedDateTime, UpdatedTime = x.UpdatedDateTime }).ToList(); @@ -420,7 +420,7 @@ public class MongoRepository : IBotSharpRepository { if (rules.IsNullOrEmpty()) return; - var ruleElements = rules.Select(x => RoutingRuleElement.ToMongoElement(x)).ToList(); + var ruleElements = rules.Select(x => RoutingRuleMongoElement.ToMongoElement(x)).ToList(); var filter = Builders.Filter.Eq(x => x.Id, Guid.Parse(agentId)); var update = Builders.Update .Set(x => x.RoutingRules, ruleElements) @@ -486,7 +486,7 @@ public class MongoRepository : IBotSharpRepository .Set(x => x.Disabled, agent.Disabled) .Set(x => x.AllowRouting, agent.AllowRouting) .Set(x => x.Profiles, agent.Profiles) - .Set(x => x.RoutingRules, agent.RoutingRules.Select(x => RoutingRuleElement.ToMongoElement(x)).ToList()) + .Set(x => x.RoutingRules, agent.RoutingRules.Select(x => RoutingRuleMongoElement.ToMongoElement(x)).ToList()) .Set(x => x.Instruction, agent.Instruction) .Set(x => x.Templates, agent.Templates) .Set(x => x.Functions, agent.Functions)