forked from bonesoul/uhttpsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIRestController.cs
More file actions
43 lines (38 loc) · 1.25 KB
/
IRestController.cs
File metadata and controls
43 lines (38 loc) · 1.25 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
38
39
40
41
42
43
using System.Collections.Generic;
using System.Threading.Tasks;
namespace uhttpsharp.Handlers
{
public interface IRestController<T>
{
/// <summary>
/// Returns a list of object that found in the collection
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<IEnumerable<T>> Get(IHttpRequest request);
/// <summary>
/// Returns an item from the collection
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<T> GetItem(IHttpRequest request);
/// <summary>
/// Creates a new entry in the collection - new uri is returned
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<T> Create(IHttpRequest request);
/// <summary>
/// Updates an entry in the collection
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<T> Upsert(IHttpRequest request);
/// <summary>
/// Removes an entry from the collection
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<T> Delete(IHttpRequest request);
}
}