Rest.Net/Rest.Net/RouteRequest.cs

40 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MontoyaTech.Rest.Net
{
/// <summary>
/// The outline of an attribute that defines a routes request type.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class RouteRequest : Attribute
{
/// <summary>
/// The type of the request.
/// </summary>
public Type RequestType = null;
/// <summary>
/// Whether or not the Request is Json Serialized. Default is true.
/// </summary>
public bool Json = true;
/// <summary>
/// Creates a default route request.
/// </summary>
public RouteRequest() { }
/// <summary>
/// Creates a route request with the request type.
/// </summary>
/// <param name="requestType"></param>
public RouteRequest(Type requestType)
{
this.RequestType = requestType;
}
}
}