-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathIResourceTypeRegistry.cs
More file actions
39 lines (35 loc) · 1.58 KB
/
IResourceTypeRegistry.cs
File metadata and controls
39 lines (35 loc) · 1.58 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
using System;
namespace JSONAPI.Core
{
/// <summary>
/// Manages registrations of this API's resource types.
/// </summary>
public interface IResourceTypeRegistry
{
/// <summary>
/// Determines whether a given type has been registered.
/// </summary>
/// <param name="type">The type</param>
/// <returns>Whether the type is registered</returns>
bool TypeIsRegistered(Type type);
/// <summary>
/// Gets the registration for the given type.
/// </summary>
/// <param name="type">The type to get the registration for</param>
/// <returns>The registration for the given type.</returns>
/// <exception cref="TypeRegistrationNotFoundException">Thrown when the type was not registered</exception>
IResourceTypeRegistration GetRegistrationForType(Type type);
/// <summary>
/// Gets the registration for the given type.
/// </summary>
/// <param name="resourceTypeName">The name of the type to get the registration for</param>
/// <returns>The registration for the given type name.</returns>
/// <exception cref="TypeRegistrationNotFoundException">Thrown when the type name was not registered</exception>
IResourceTypeRegistration GetRegistrationForResourceTypeName(string resourceTypeName);
/// <summary>
/// Adds a registration to the registry.
/// </summary>
/// <param name="registration">The registration to add</param>
void AddRegistration(IResourceTypeRegistration registration);
}
}