Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd property to POCO class at runtime
    primarykey
    data
    text
    <p>I selected <a href="https://github.com/ServiceStack/ServiceStack.OrmLite" rel="noreferrer">ServiceStack OrmLite</a> for my project which is a pure Data-Oriented application. I am willing to allow the end user to create his own Object Types defined in an XML format that will be used to generate classes at runtime using <a href="http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx" rel="noreferrer">CodeDOM</a>.</p> <p>I will be also defining some "system" objects required by the application (i.e. <code>User</code>) but I cannot foresee all the properties the end user will use and therefore I am looking for a way to allow extending the classes I create in design time. Sample bellow</p> <pre><code>public class User { public Guid Uid { get; set; } public String Username { get; set; } public String Password { get; set; } } </code></pre> <p>The end user wants to have an <code>Email</code> and an <code>Address</code>. He should be able to add the 2 properties to the upper class and the whole class will be (which still can be used by OrmLite, since it allows overwriting :</p> <pre><code>public class User { public Guid Uid { get; set; } public String Username { get; set; } public String Password { get; set; } public String Email{ get; set; } public String Address { get; set; } } </code></pre> <p>I know that there might be a risk of doing so to crash the system (if the class is already instantiated) so I am looking for the best way to avoid this issue and mimic the need I have.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload