Class CustomAttributeDictionary
Represents a collection of custom attribute values.
Implements
Inherited Members
Namespace: Nevatech.Vsb.Repository.Entities
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class CustomAttributeDictionary : Dictionary<int, string>, IDictionary<int, string>, ICollection<KeyValuePair<int, string>>, IDictionary, ICollection, IReadOnlyDictionary<int, string>, IReadOnlyCollection<KeyValuePair<int, string>>, IEnumerable<KeyValuePair<int, string>>, IEnumerable, ISerializable, IDeserializationCallback
Constructors
CustomAttributeDictionary()
Initializes an empty instance.
Declaration
public CustomAttributeDictionary()
Methods
IsEquivalent(CustomAttributeDictionary)
Compares items in this dictionary with items in the provided dictionary
using custom attribute specific comparison rules. For example, if attribute
does not exist in the dictionary, it is assumed that its value is Null. If
attribute is not provided in the other
dictionary, it is
assumed that its value is not changed.
Declaration
public bool IsEquivalent(CustomAttributeDictionary other)
Parameters
Type | Name | Description |
---|---|---|
CustomAttributeDictionary | other | Custom attributes to compare with. |
Returns
Type | Description |
---|---|
Boolean | True if dictionaries are equivalent. Otherwise false. |
Remarks
For accurate results this method should be called on the dictionary that belongs to an existing entity, and provided dictionary should belong to an updated entity.
Validate(ICollection<CustomAttributeType>, Boolean)
Checks if all items belongs to the provided collection of the allowed attributes and satisfy their type requirements.
Declaration
public string Validate(ICollection<CustomAttributeType> attributeTypes, bool ensureRequired)
Parameters
Type | Name | Description |
---|---|---|
ICollection<CustomAttributeType> | attributeTypes | Collection of attribute types defining the attributes that are allowed to be in this dictionary. |
Boolean | ensureRequired | Flag indicating that all required attributes must be present in this dictionary. |
Returns
Type | Description |
---|---|
String | Message explaining the found errors or Null, if no errors are found. |