Binda.ListControlBindaStrategy.GetCollection C# (CSharp) Method

GetCollection() protected method

protected GetCollection ( object source, string propertyName, object value ) : IList
source object
propertyName string
value object
return IList
        protected IList GetCollection(object source, string propertyName, object value)
        {
            var collectionPropertyName = propertyName.Pluralize();
            var collectionProperty = source.GetType().GetProperty(collectionPropertyName);
            var collection = collectionProperty == null ? new[] {value} : (IList) collectionProperty.GetValue(source, null);
            return collection;
        }