public HiddenClassSchema AddProperties(IEnumerable<PropertyNameAndValue> properties)
{
if (this.properties == null)
{
var propertyDictionary = new Dictionary<object, SchemaProperty>(properties.Count());
int nextValueIndex = 0;
foreach (var property in properties)
propertyDictionary.Add(property.Key, new SchemaProperty(nextValueIndex ++, property.Attributes));
return new HiddenClassSchema(propertyDictionary, nextValueIndex);
}
else
{
// There are already properties in the schema. Just add them one by one.
HiddenClassSchema newSchema = this;
foreach (var property in properties)
newSchema = AddProperty(property.Key, property.Attributes);
return newSchema;
}
}