Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to persist Display properties associated to C# Class properties in database?
    primarykey
    data
    text
    <p>So here is the current problem I'm facing:</p> <ol> <li><p>I have C# Business Object classes that are generated dynamically from XML Schema.</p></li> <li><p>I build forms dynamically to display and capture data bound to my Business Objects.</p></li> <li><p>I store my serialized (xml) objects into the database.</p></li> <li><p>I need to persist the display properties associated to each Property in my Business Object C# classes (How to accomplish this??)</p></li> </ol> <p>Lets say I have a Person Business Object:</p> <pre><code>public class Person { public string Name {get;set;} public PhoneType Phone {get;set;} } public class PhoneType { public string HomePhone{get;set;} public string WorkPhone{get;set;} } </code></pre> <p>Now let's say I create a new Person:</p> <pre><code>Person me = new Person(); me.Name = "BOB"; me.Phone = new PhoneType() me.Phone.HomePhone = "1234"; me.Phone.WorkPhone = "4321"; </code></pre> <p>Now when I build my form I know that Person.Name is a TextBox of Width = 300 and Height = 30 and my PhoneType.HomePhone and PhoneType.WorkPhone are TextBoxes of Width 200 and Height = 30. </p> <p>What are the best ways to persist those Display Properties in the DataBase and associate them to each of the Properties in my Business Objects? Considering that most of my Business Objects are represented by very deep object graphs... so I'm wondering what the best way is to recursively store and regenerate display properties from Database based on the deep hierarchical nature of my model.</p> <p>Now a few conditions: -I don't want to store static forms since my application is very dynamic. XSD -> Code -> Form -Display properties may be user-specific (e.g. backcolor of certain field), so can't just have generic form templates -I just need a good mechanism to associate POCO properties to display properties so I can build my forms on the fly and persist changes to the database</p> <p>I'm currently exploring the possibility of creating a PropertyBag (collection) property in each of my Business Objects and populate them recursively as I navigate the object graph, but haven't gone far yet..</p>
    singulars
    1. This table or related slice is empty.
    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