Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Most APIs in EPiServer CMS returns read-only instances of objects, for example DataFactory.GetPage return a read-only PageData. To make changes to read-only instances a writable clone has to be created using the CreateWritableClone method.
The implementation has the following advantages:
All classes that have the read-only support implements the IReadOnly<T> interface which is defined as follows:
public interface IReadOnly
{
void MakeReadOnly();
bool IsReadOnly
{
get;
}
}
public interface IReadOnly<T> : IReadOnly
{
T CreateWritableClone();
}
To give some background to what is happening behind the scenes, the life cycle of a typical PageData object is as follows:
Last updated: Feb 23, 2015