IDataUnpacker Interface
.NET Standard 2.x
Represents an object that can unpack a data package which contains multiple types of elements.
The data package must conform to the specified package format.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
public interface IDataUnpacker;
Properties
Name | Return Type | Description |
---|---|---|
Count | int | Gets the number of elements added in the IDataUnpacker object. |
DataFormat | DataFormat | Gets the format of the text specified when creating the IDataUnpacker object. |
Keys | string[] | Gets the keys of all of the elements in the IDataUnpacker object. |
Raw | string | Gets the raw string of text which contains all of the elements in the IDataUnpacker object. |
Methods
Name | Return Type | Description |
---|---|---|
ContainsKey(string key) | bool | Checks whether the specified key exists in the IDataUnpacker object. |
GetRaw(string key) | string | Gets the raw string of text for the specified element. |
RemoveKey(string key) | bool | Removes the element from the IDataUnpacker object according to the specified key. |
Extension Methods
Name | Return Type | Description |
---|---|---|
GetDataTable([NotNull]this IDataUnpacker dataUnPackage, [NotNull]string key) | DataTable | Gets the DataTable object created by the specified element. |
GetModel<TModel>([NotNull]this IDataUnpacker packer, [NotNull]string key) | IDataIncludeGetter<TModel> | Gets the model object created by the specified element. |
GetModelEntries<TModel>([NotNull]this IDataUnpacker packer, [NotNull]string key) | IEnumerable<IModelEntry<TModel>> | Gets the IEnumerable<IModelEntry<TModel>> object created by the specified element. |
GetModelEntries<TModel>([NotNull]this IDataUnpacker packer, [NotNull]string key, [NotNull]MappingMethod mappingMethod) | IEnumerable<IModelEntry<TModel>> | Gets the IEnumerable<IModelEntry<TModel>> object created by the specified element. You can also specify the mapping method for importing data into each IModelEntry<TModel> object. |
GetModels<TModel>([NotNull]this IDataUnpacker packer, [NotNull]string key) | IDataIncludeGetter<TModel> | Gets the list of model objects created by the specified element. |