BotSharp/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentRuleMongoElement.cs

34 lines
905 B
C#
Raw Normal View History

2025-01-06 05:54:48 +00:00
using BotSharp.Abstraction.Agents.Models;
namespace BotSharp.Plugin.MongoStorage.Models;
2025-01-07 19:50:50 +00:00
public class AgentRuleMongoElement
2025-01-06 05:54:48 +00:00
{
2025-01-08 17:07:13 +00:00
public string TriggerName { get; set; }
2025-01-06 05:54:48 +00:00
public bool Disabled { get; set; }
public string EventName { get; set; }
public string EntityType { get; set; }
2025-01-07 19:50:50 +00:00
public static AgentRuleMongoElement ToMongoElement(AgentRule rule)
2025-01-06 05:54:48 +00:00
{
2025-01-07 19:50:50 +00:00
return new AgentRuleMongoElement
2025-01-06 05:54:48 +00:00
{
2025-01-08 17:07:13 +00:00
TriggerName = rule.TriggerName,
2025-01-06 05:54:48 +00:00
Disabled = rule.Disabled,
EventName = rule.EventName,
EntityType = rule.EntityType
};
}
2025-01-07 19:50:50 +00:00
public static AgentRule ToDomainElement(AgentRuleMongoElement rule)
2025-01-06 05:54:48 +00:00
{
2025-01-07 19:50:50 +00:00
return new AgentRule
2025-01-06 05:54:48 +00:00
{
2025-01-08 17:07:13 +00:00
TriggerName = rule.TriggerName,
2025-01-06 05:54:48 +00:00
Disabled = rule.Disabled,
EventName = rule.EventName,
EntityType = rule.EntityType
};
}
}