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
|
|
|
|
{
|
|
|
|
|
|
public static class IntentExtension
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string CreateIntent(this Agent agent, Database dc, Intent intent)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dc.Table<Intent>().Any(x => x.Id == intent.Id)) return intent.Id;
|
|
|
|
|
|
|
|
|
|
|
|
dc.Table<Intent>().Add(intent);
|
|
|
|
|
|
|
|
|
|
|
|
return intent.Id;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|