-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRelations.cs
More file actions
37 lines (34 loc) · 1.16 KB
/
Relations.cs
File metadata and controls
37 lines (34 loc) · 1.16 KB
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
37
using System;
using System.Collections.Generic;
using Simplify.Web.Attributes;
namespace Simplify.Web.Http;
/// <summary>
/// Provides the types relations container.
/// </summary>
public static class Relations
{
/// <summary>
/// Provides the HTTP method to HTTP method attribute relations
/// </summary>
public static readonly IReadOnlyDictionary<HttpMethod, Type> HttpMethodToHttpMethodAttributeRelation = new Dictionary<HttpMethod, Type>
{
{ HttpMethod.Get, typeof(GetAttribute) },
{ HttpMethod.Post, typeof(PostAttribute) },
{ HttpMethod.Put, typeof(PutAttribute) },
{ HttpMethod.Patch, typeof(PatchAttribute) },
{ HttpMethod.Delete, typeof(DeleteAttribute) },
{ HttpMethod.Options, typeof(OptionsAttribute) }
};
/// <summary>
/// Provides the HTTP method to HTTP method string attribute relations
/// </summary>
public static readonly IReadOnlyDictionary<HttpMethod, string> HttpMethodToToHttpMethodStringRelation = new Dictionary<HttpMethod, string>
{
{ HttpMethod.Get, "GET" },
{ HttpMethod.Post, "POST" },
{ HttpMethod.Put, "PUT" },
{ HttpMethod.Patch, "PATCH" },
{ HttpMethod.Delete, "DELETE" },
{ HttpMethod.Options, "OPTIONS" }
};
}