I'm looking for possible ways to persist the following classes. Subsonic SimpleRepository looks like it might work, and people have said it should, when I asked a more general question.
But I've been unable to find a single example of how to do this - or at least one I could understand.
Can anyone point me to an example, or tell me how I could use Subsonic to map the following classes to a database?
Note that I haven't designed the database - I'm hoping Subsonic will do that for me, lazy sod that I am...
Edit: Just to expand on the previous point - I'm hoping to have Subsonic convert my object model to a relational DB, dealing with all the Parent-Child and One-To-Many relationships that are implied. Currently, I don't think Subsonic can do this. But even a working example (not a code fragment) that explicitly managed foreign keys, etc in the object model would be useful.
Some background and notes on the classes I want to persist:
- they are used by the software that controls some measuring equipment
- the Data class contains an array of RunData objects called RunFn, which holds the data for up to 10 individual measurement runs
- note that RunData also contains an array of floats - RawY
- if necessary, we can change the arrays to some other type of collection (List<>, etc)
- developing in C#, VS2008, for SQL Server Express
Edit: I'm using Subsonic 3.0.0.3.
public class RunData
{
public DateTime StartDateTime { get; set; }
public TimeSpan ElapsedTime { get; set; }
private float[] _rawY;
public float[] RawY
{
get
{
return _rawY;
}
set
{
_rawY = value;
}
}
}
public Data
{
public string OperatorId { get; set; }
public string SampleId { get; set; }
// CAN SUBSONIC DEAL WITH THIS ARRAY OF OBJECTS???
private RunData[] _runFn;
public RunData[] RunFn
{
get
{
return _runFn;
}
set
{
_runFn = value;
}
}
}