BotSharp/BotSharp.Core/Intents/IntentExpression.cs
haiping008@gmail.com 6c472545c0 Rename project
2018-03-28 17:08:49 -05:00

34 lines
860 B
C#

using BotSharp.Core.Expressions;
using EntityFrameworkCore.BootKit;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
namespace BotSharp.Core.Intents
{
[Table("Bot_IntentExpression")]
public class IntentExpression : DbRecord, IDbRecord
{
public IntentExpression()
{
Data = new List<IntentExpressionPart>();
}
[Required]
[StringLength(36)]
public String IntentId { get; set; }
[ForeignKey("ExpressionId")]
public List<IntentExpressionPart> Data { get; set; }
public bool IsExist(Database dc)
{
return dc.Table<IntentExpression>().Any(x => x.IntentId == IntentId);
}
}
}