PstrfGetPropertyStorageName static method class [Information](fo_methods-class-information.html) allows you to [name of storage .Net-properties set by the attribute PropertyStorageAttribute`](fo_storing-data-objects.html).
Method without using the index
The method does not require specifying an index when you call, have the following form:
/// <param name="type">.Net class type of the data object</param>
/// <param name="property">the property name</param>
/// <returns>the name of the storage</returns>
static public string GetPropertyStorageName(System.Type type, string property)
This method should be used if the property attribute is PropertyStorageAttribute is:
[PropertyStorage("TimeQu"))
Method using index
Method that requires an index when you call, have the following form:
/// <param name="type">.Net class type of the data object</param>
/// <param name="property">the property name</param>
/// <param name="index">the index to set</param>
/// <returns>the name of the storage</returns>
static public string GetPropertyStorageName(System.Type type, string property, int index)
This method should be used if the attribute Declaration properties PropertyStorageAttribute used an array of names:
PropertyStorage(new string[]) {"Postclass"}))
In this case, the parameter index will determine the element number of the array names specified in the attribute Declaration properties PropertyStorageAttribute, which will be returned by the method.
Erroneous Information.GetPropertyStorageName
- If the attribute
PropertyStorageAttributewas declared without an array, but use the callInformation.GetPropertyStorageNameindex, an exception will be thrown. - If the attribute
PropertyStorageAttributewas declared with an array, but use the callInformation.GetPropertyStorageNamewithout an index, then an empty string is returned.
Features of generation attribute properties PropertyStorage
- Attribute
Storagespecified for the class properties, after generation will be presented in the form of attribute declarationsPropertyStoragewithout the array. - Attributes
Aggregator Storagedyelovoi links andStorageartisan links after generation will be presented in the form of attribute declarationsPropertyStoragewithout the array, if the following conditions are met: - Storage-attribute contains only one nonempty value.
- Attribute a typeusage contains more than one value.