1
Vote

Handling of Multivalued attribute

description

Hi All

I want to create new person that have one attribute of type string and it contain multivalued information.
can you suggest how to declare a multivalued property and add the multiple value on it with the help of RmPerson or RmResource.

As per example I found only Get property not set

RmList<string> _proxyAddressCollection;
   public IList<string> ProxyAddressCollection {
        get {
            if (_proxyAddressCollection == null) {
                lock (base.attributes) {
                    _proxyAddressCollection = GetMultiValuedString(AttributeNames.ProxyAddressCollection);
                }
            }
            return _proxyAddressCollection;
        }
    }
please help me to define set for this.

thanks
Abhishek

comments

mgercevich wrote Dec 10, 2013 at 3:11 PM

Have you tried something like this?
List<string> myValues = new List<string>() { "value1", "value2", "value3" };
RmAttributeName attrMyValues = new RmAttributeName("ProxyAddress");
RmAttributeValue values = new RmAttributeValueMulti(myValues.ToArray());
if (rmResource.Attributes.ContainsKey(attrMyValues))
{
    rmResource.Attributes[attrMyValues] = values;
}
else
{
    rmResource.Attributes.Add(attrMyValues, values);
}