Note that there are some explanatory texts on larger screens.

plurals
  1. POSubsonic - can anyone provide an example of using Subsonic SimpleRepository to persist a list/array of objects?
    primarykey
    data
    text
    <p>I'm looking for possible ways to persist the following classes. Subsonic <strong>SimpleRepository</strong> looks like it might work, and people have said it should, when I asked a <a href="https://stackoverflow.com/questions/1527805/orms-that-work-with-complex-net-generic-objects-e-g-nested-list-etc">more general question</a>.</p> <p>But I've been unable to find a single example of how to do this - or at least one I could understand. </p> <p>Can anyone point me to an example, or tell me how I could use Subsonic to map the following classes to a database?</p> <p>Note that <strong>I haven't designed the database</strong> - <strong>I'm hoping Subsonic will do that for me</strong>, lazy sod that I am...</p> <p><strong>Edit:</strong> 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 <strong>working example</strong> (not a code fragment) that explicitly managed foreign keys, etc in the object model would be useful.</p> <p>Some background and notes on the classes I want to persist:</p> <ul> <li>they are used by the software that controls some measuring equipment </li> <li>the <strong>Data</strong> class contains an array of <strong>RunData</strong> objects called <strong>RunFn</strong>, which holds the data for up to 10 individual measurement runs </li> <li>note that <strong>RunData</strong> also contains an array of floats - <strong>RawY</strong></li> <li>if necessary, we can change the arrays to some other type of collection (List&lt;>, etc)</li> <li>developing in C#, VS2008, for SQL Server Express</li> </ul> <p><strong>Edit:</strong> I'm using Subsonic 3.0.0.3.</p> <pre><code>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; } } } </code></pre>
    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.
 

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