Try our conversational search powered by Generative AI!

Class PropertyBagObjectsExtensions

Class with extension methods for PropertyBag

Inheritance
System.Object
PropertyBagObjectsExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Data.Dynamic
Assembly: EPiServer.Data.dll
Version: 7.19.2
Syntax
public static class PropertyBagObjectsExtensions

Methods

ToPropertyBag(Object)

Create a PropertyBag instance and populates it with its properties The algorith for extracting properties is as follows: 1) Property must a have a getter and setter 2a) Getter must be public OR 2b) The class must be marked either with the System.Runtime.Serialization.DataContractAttribute or EPiServerDataContractAttribute and the property must be marked either with the System.Runtime.Serialization.DataMemberAttribute or EPiServerDataMemberAttribute

Declaration
public static PropertyBag ToPropertyBag(this object value)
Parameters
Type Name Description
System.Object value

The System.Object to convert

Returns
Type Description
PropertyBag

A new PropertyBag instance

ToPropertyBag(Object, IEnumerable<String>)

Create a PropertyBag instance and populates it with its properties

Declaration
public static PropertyBag ToPropertyBag(this object value, IEnumerable<string> propertyNames)
Parameters
Type Name Description
System.Object value

The System.Object to convert

System.Collections.Generic.IEnumerable<System.String> propertyNames

The names of the properties to extract a place into the property bag

Returns
Type Description
PropertyBag

A new PropertyBag instance