Class MetadataFactory
- Namespace
- Savvyio
- Assembly
- Savvyio.Core.dll
Provides access to factory methods for maintaining metadata in models.
public static class MetadataFactory
- Inheritance
-
objectMetadataFactory
Methods
Get<T>(T, string)
Gets the value associates to the request from the item with the specified key.
public static object Get<T>(T request, string key) where T : IMetadata
Parameters
Returns
- object
A reference to the value in the
requestthat is identified bykey, if the entry exists; otherwise,null.
Type Parameters
TThe model that implements the IMetadata interface.
Set<T>(T, string, object)
Assigns a new value to the request on the item with the specified key.
public static T Set<T>(T request, string key, object value) where T : IMetadata
Parameters
requestTThe IMetadata to extend.
keystringThe key of the element to retrieve.
valueobjectThe value of the element to change.
Returns
- T
A reference to
requestafter the operation has completed.
Type Parameters
TThe model that implements the IMetadata interface.
Exceptions
- ArgumentNullException
requestcannot be null -or-keycannot be null.