BotSharp/BotSharp.Core/Intents/IntentDriver.cs

22 lines
504 B
C#
Raw Normal View History

2018-03-28 22:08:49 +00:00
using BotSharp.Core.Agents;
2018-01-02 18:05:35 +00:00
using EntityFrameworkCore.BootKit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
2018-03-28 22:08:49 +00:00
namespace BotSharp.Core.Intents
2018-01-02 18:05:35 +00:00
{
2018-05-23 05:11:15 +00:00
public static class IntentDriver
2018-01-02 18:05:35 +00:00
{
2018-05-23 05:11:15 +00:00
public static String CreateIntent(this Agent agent, Database dc, Intent intent)
2018-01-02 18:05:35 +00:00
{
if (dc.Table<Intent>().Any(x => x.Id == intent.Id)) return intent.Id;
dc.Table<Intent>().Add(intent);
return intent.Id;
}
}
}