subsonic3

ActiveRecord fundamentally incompatible with composite keys?

I have been attempting to use subsonic for a project on which I'm working. All was going quite well until I encountered a link table with a composite primary key. That is a key made up of the primary keys of the two tables it joins. Subsonic failed to recognize both keys which was problematic. I was going to adjust subsonic to suppor...

How does one programmaticaly specify the name of the connection for SubSonic 3

Here is the situation. I am using SubSonic 3 and would like to specify at run time which connection string to use. This a command line application and the connection string name will be specified by the user as a command line argument. What is the best way to accomplish this? ...

Subsonic Setup question using T4

I am sorry I have searched Stackoverflower for this one but can't find a problem similar... I changed the settings.tt file to point to my connection string and when I compile I get this: Error 2 Running transformation: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0. ...

Subsonic error: Unknown column 't0.CartQuantity' in 'field list'

Hello, I added a custom property to a generated class from the database using a partial class and for some reason everytime I query my table it tries to look for the custom property as a column in the database and that's when I get this error, is there a way to tell subsonic that my property is not a column in the database? I'm using My...

How to implemet custom Distinct in Subsonic 3

I have got an error: Unable to cast object of type 'System.Linq.Expressions.MethodCallExpression' to type 'SubSonic.Linq.Structure.ProjectionExpression' when I try to call distinct in collection of orders: var distinctOrders = user.Orders.Distinct(new OrderComparer()).ToList(); OrderComparer class has a standard implementation like:...

Insert using linq templates not returning the id - MySQL

I'm using the latest subsonic dll and the latest linq templates from github. The db i'm inserting into is MySQL. Id column on table is primary key auto increment. Versions: Subsonic.Core.dll - 3.0.0.3 - (November 18, 2009 Merged pulls from Github). LinqTemplates - July 29, 2009. MySQL.Data.CF.dll - 6.1.2.0. The row is inserted but th...

Repository.tt subsonic3

where can i find the latest Repository.tt template? Is the latest one here: http://blog.wekeroad.com/blog/subsonic-3-0-repository-template-update/ - November 2008? I can't seem to find the repository.tt file on github. I'm using the latest linq templates. I've read that the repository class is generated from the default templates. I ca...

Subsonic 3.x: ArgumentException while querying (LINQ)

Even a simple query like EmmaDatabase.EmmaDB ec = DatabaseProvider.GetEmmaDatabase(); var changes = (from o in ec.dbCachedChanges select o); Throws me an ArgumentException (Argument types do not match) while iterating over it. The Stacktrace only contains at System.Linq.Expressions.Expression.Bind(MemberInf...

Subsonic - Filter by XML Column DataType

I have downloaded Subsonic 3.0.0.3 and I have a XML DataType in my MSSQL database. The property comes back as a string which is fine however how do I create a line of code to filter by contents in that column. If I try something like from x in Table.All() where x.XMLColumn.Contains("test") it throws an exception because although the p...

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

Debug tt templates in VS2008

Is there a way to debug tt files? I have installed SubSonic3 and all the templates do their job except the StoredProcedures.tt. It remains empty after 'Run Custom Tool'. ...

SubSonic 3 Repository - SQLite In-Memory

Before I invest the time in modifying the SubSonic 3 source, I figured I ask to see if I'm missing something simple. Is it possible to use the SubSonic 3 Repository with migrations on a SQLite In-Memory database? I couldn't find a way to force the DbDataProvider to keep the connection open so the In-Memory SQLite database doesn't vanish...

How do I setup my POCO's with Subsonic 3 and the SimpleRepostitory? or where is the convention?

Is there someplace that details how to setup your POCO's when using the SimpleRepository with SubSonic 3? It sounds like it's convention over configuration, but I can't find where that convention is explained. http://www.subsonicproject.com/docs/Conventions looks like it was meant for 2.0, and is also marked incomplete. (BTW: I'd lov...

problem with delete when multiple columns

hiya when deleteing this works: orderitems.Delete(x => x.orderitem_sessionid == transkey); however this does not work orderitem.Delete(x => x.orderitem_sessionid == transkey && x.orderitem_productid == 6); i get no errors, but nothing is deleted either, i have working code as a substitute of var Deleteable...

SubSonic3 StoredProcedures.tt & SQLServer.ttinclude

In the template to get the stored procedures I see this line if(spType=="PROCEDURE" &! sp.Name.StartsWith("sp_")){... Why can't the sp's start with sp_? ...

Question about Northwind DB example

When messing with the Subsonic 3.0 Northwind stuff: var product = Product.SingleOrDefault(x => x.ProductID == 1); I found the following was possible, but not workable) using intellisense: var product = Product.SingleOrDefault(x => x.OrderDetails == 1); OrderDetails as a member of Product, is an IQueryable. I guess I'm new to LINQ,...

Subsonic 3 query like clause

This may be another of those "should be simple" things, but I can't find anything on it so here I am asking what will most likely be a stupid question :$ I'm using SubSonic 3 and I want to execute a query with a like clause but can't find that as an option. My straight SQL is like so: select * from table where column like %value% or co...

Dynamic Data with Subsonic 3

i want to make a webproject with Subsonic and Dynamic Data... But when i go register the ContextData a don't have it in subsonic with LINQ... in Global.asax.cs a have to do something like this model.RegisterContext(SubSonicRepo, new ContextConfiguration() { ScaffoldAllTables = true }); how can i make it work? have some way to make ...

Setting up SubSonic with Databases other than SQL Server

I am currently using SubSonic (2.2 and 3) for some ASP.NET projects and have managed to get them working with SQL Server (using ActiveRecord). However, I also want to know how to set it up with other (open source) databases, e.g. PostgreSQL and SQLite. This is so I can use it on a web host without SQL Server on. The providers I have foun...

How to extend models in SS3 like Rails does?

Hi, I have a new app that I am starting tomorrow based on SubSonic3 (ActiveRecord) and ASP.NET MVC. In thinking through how to organize the models layer, I know I'd like to extend most if not all of the models and add functionality (like virtual attributes, etc.) in a similar way that I do now with Rails. I've used SS2 in the past but ...