using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
namespace BotSharp.Platform.Models.Intents
{
///
/// Intent Table
///
public class Intent
{
[Required]
[StringLength(36)]
public String AgentId { get; set; }
[MaxLength(64)]
public String Name { get; set; }
[MaxLength(256)]
public String Description { get; set; }
[ForeignKey("IntentId")]
public List Contexts { get; set; }
[ForeignKey("IntentId")]
public List Events { get; set; }
///
/// Get input contexts hash
///
[NotMapped]
public String ContextHash
{
get
{
return string.Empty;
/*return Contexts == null || Contexts.Count == 0
? Guid.Empty.ToString("N")
: $"{String.Join(",", Contexts.OrderBy(x => x.Name).Select(x => x.Name))}".GetMd5Hash();*/
}
}
[ForeignKey("IntentId")]
public List UserSays { get; set; }
[ForeignKey("IntentId")]
public List Responses { get; set; }
}
}