-
Notifications
You must be signed in to change notification settings - Fork 178
/
Copy pathLuisIntentAttribute.cs
36 lines (33 loc) · 1.1 KB
/
LuisIntentAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
namespace Bot.Builder.Community.Dialogs.Luis
{
/// <summary>
/// Associate a LUIS intent with a dialog method.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
[Serializable]
public class LuisIntentAttribute : AttributeString
{
#pragma warning disable SA1401 // Fields must be private
/// <summary>
/// The LUIS intent name.
/// </summary>
public readonly string IntentName;
#pragma warning restore SA1401 // Fields must be private
/// <summary>
/// Construct the association between the LUIS intent and a dialog method.
/// </summary>
/// <param name="intentName">The LUIS intent name.</param>
public LuisIntentAttribute(string intentName)
{
SetField.NotNull(out this.IntentName, nameof(intentName), intentName);
}
protected override string Text
{
get
{
return this.IntentName;
}
}
}
}