simplerepository

Can SubSonic's SimpleRepository operate in-memory?

I'm working with Subsonic's SimpleRepository, and I'm trying to write some unit tests so they don't touch the database, but I'm having trouble figuring out if SimpleRepository can work against in-memory lists (Like the active record can) instead of an actual database. I would like to do the following: //setup test data var repo=new Sim...

Subsonic 3, SimpleRepository, SQL Server: How to find rows with a null field?

How ca I use Subsonic's Find<T> method to search for rows with a field containing the "null" value. For the sake of the discussion, let's assume I have a c# class called "Visit" which contains a nullable DateTime field called "SynchronizedOn" and also let's assume that the Subsonic migration has created the corresponding "Visits" table a...

Subsonic: Simple Repository - Update Crash

Whenever I attempt to use a simple repository to simply update a record, I get an object reference not set to an instance of an object error. I suspect that I am doing something incorrect, can anyone see a problem with the below lines of code for saving data to subsonic? I'm using .Net 3.5, SQL Server 2008 and Subsonic 3.0. Thanks for...

Parent and Child object in SimpleRepository

How would it work in Subsonic's SimpleReporitory if I wanted to be able to have a 1 to many relationship between objects? Would I have to create a bridge object and then build my parent object at runtime, or is this support built in? What I am looking for is the folowing: Adam's Example Shop... Public Class Shop Private m_id As...

Db4o object update

Hi, I'm using db4o for a simple app, with an embedded db. When I save an object, and then change the object, is it suppose that db4o returns the changed object? Here's the code: [Test] public void NonReferenceTest() { Aim localAim = new Aim("local description", null); dao.Save(localAim); // changing the loca...

SubSonic generated DB Schema, binary types?

How do you create binary columns in the DB using SubSonic's Schema builder? So tonight I decided to dive into SubSonic. I see a lot of questions on here and great responses by Rob and many others. I see that SubSonic is an ORM, with the T4 Templates it can generate some very nice and efficient classes from an existing database. But, I...

Lifetime management of a SimpleRepository

I'm just starting with SubSonic 3 and playing with the SimpleRepository approach. What's the intended lifetime of SimpleRepository classes when used in a desktop application? Are you expected to keep creating a new instance for everytime you want to touch the database? Should I create an instance to use for each group of database calls ...

Subsonic:SimpleRepository Parent Child relationship

Hi, I am trying to use the SimpleRepository feature in Subsonic3 - first of all, I must say a big thanks to RobC - Subsonic really rocks, and I can't wait to see additional updates to the SimpleRepository. I am a big fan of the migration approach (developer/class driven rather than starting with the DB). I have had a look at the post he...

Does SimpleRepository support any in-memory or other "alternative" database engines?

I am looking for options other than MS SQL Server/Express. There seem to be quite a few file based or in-memory database engines supporting some subset or dialect of SQL. Preferably it would be an engine not requiring installation at all. Is any of them supported by SimpleRepository? Is any of them supported by ActiveRecord? Is there at...

How do I use SimpleRepository without the migration approach?

I am evaluating SubSonic for use in Phase 2 of a large project. This is an ASP.NET project, with 700 tables in a SQL Server database. We are planning for our domain model to consist of POCO classes to assist with an offline access requirements we have. I believe that the SimpleRepository pattern would be among my best options. Since ...

How do you handle SubSonic 'relationships' with migration?

According to this article: http://subsonicproject.com/docs/3.0%5FMigrations Bottom line: if you're a developer that is concerned about database design, migrations might not be for you. Ok, that's fine, I can treat the database as simply a persistent repository of data that doesn't contain any business logic. In other words, a glorifie...

Subsonic - can anyone provide an example of using Subsonic SimpleRepository to persist a list/array of objects?

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 ...

Get distinct month and year with SubSonic

I have date type column (MySQL): SELECT invdate FROM invoices; invdate ------- 2009-08-22 2009-07-12 2009-08-23 ------- and I want get month and year like this: SELECT DISTINCT MONTH(invdate) AS invmonth, YEAR(invdate) AS invyear FROM invoices; how to use in C# with SubSonic (SimpleRepository)? TIA ...

Manage data structures in the database or in code?

I've always had a difficult time deciding where the best place is to manage my "master" set of data structures for my data access layer. Traditionally, I've always started with a database and used a code generation tool to get a set of code models (i.e. ActiveRecord in SubSonic). Lately, however, I've been attracted by the idea of mana...

Subsonic map POCO to table of a different name

I started a small project and wanted to use Subsonic's SimpleRepository for my database layer. If I have table in my database called Member and I want to create a POCO called TeamMember. Can I map class TeamMember to table Member via an attribute or some other method? It is possible that what I'm asking is not how the SimpleRepositor...

Subsonic Simple Repository String Lengths

I'm playing around with the SimpleRepository provider (with automigrations) in SubSonic 3 and I have an annoying problem: The only way I can control the string length in my database tables is by adding the SubSonicStringLength or SubSonicLongString attributes to the properties of the objects that need to be persisted. I don't really w...

Subsonic Simple Repo for high volume site

Simple Repo has given me a competitive edge in my consulting. I can finish projects much faster than I could in the "cmd.Parameters.Add(param)" days. As things progress on this end im getting into higher volume sites and wondering if Simple Repo is still the way to go. Im wondering what people's experiences have been putting SR into prod...

Subsonic SimpleRepository Nullable string problem

Hi I am having a problem with subsonic simplerepository. I have a users class and it has some optional fields.these optional fields are of type string. As soon as I try to persist my object , if the optional fields are null , an exception is being thrown I know string is already of type nullable so i cannot do something like nullab...

SubSonic Simple Repository One-To-Many

Hi, I made a class like: public class Video { public Guid VideoID { get; set; } public VideoCategory VideoCategory { get; set; } public int SortIndex { get; set; } public string Title { get; set; } public string Body { get; set; } public string Author { get; set; } public string Filename { get; set; } p...

Subsonic adding a DB provider for Simple Repository

Hey guys, I was wondering--what part of Subsonic 3 needs to be modified to support a different database under a Simple Repository scenario? I haven't found any documentation on this point. Subsonic 3 seems to be all about the T4 templates but when I check out the Subsonic project sources I don't see any T4 templates in there...so wher...