public void SetAttributeValue(string attributeId, DocumentAttributeValue value) { if (string.IsNullOrEmpty(attributeId) || value == null) { throw new Exception("AttributeIs or Value can't be null or empty"); } if (!values.ContainsKey(attributeId)) { values.Add(attributeId, value); } else { values[attributeId] = value; } }
public void SetAttributeValue(string documentId, string attributeId, DocumentAttributeValue value) { if (!documentsDictionary.ContainsKey(documentId)) { throw new Exception($"Incorrect documentId: {documentId}"); } if (string.IsNullOrEmpty(attributeId)) { throw new Exception("attributeId can't be null or empty"); } if (value == null) { throw new Exception("document attribute value can't be null"); } documentsDictionary[documentId].SetAttributeValue(attributeId, value); if (!usedAttributeIds.Contains(attributeId)) { usedAttributeIds.Add(attributeId); } }