I'm new to C# and Subsonic. I'm trying to solve the following case:
public class UnknownInt {
public int val;
public bool known;
}
public class Record {
public int ID;
public UnknownInt data;
}
I'm using SimpleRepository. Is there a way I can get UnknownInt serialized before storing it in the SQL database (perhaps as XML text field?)
I'm trying to build a questionnaire system in which a user can provide an 'integer' answer, an 'Unknown' answer, as well as a Null answer (question not answered yet)
In other words - what interfaces does my UnknownInt class need to implement in order to be eligible and convertible into SubSonic 3.0 Simple Repository?
Cheers!
I would do this:
The basic idea is to have to columns that store your userdefined type but are hidden from intellisense (System.ComponentModel.EditorBrowsable attribute). Than you have a complex type (I prefer a struct rather than a class in this case) that is hidden from SubSonic's simple repository. The overrides and operator overloads are optional but make working with this type easier.
Example usage: