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

34 lines
870 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
{
public string Name { get; set; }
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
{
Name = rule.Name,
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
{
Name = rule.Name,
Disabled = rule.Disabled,
EventName = rule.EventName,
EntityType = rule.EntityType
};
}
}