subsonic-active-record

Subsonic 3 and Activerecord isn't generating MySQL Stored Procedures

It seems that the included T4 templates (or the one in the SVN trunk for that matter) just skips generating SPs for MySQL... When running StoredProcedures.ttinclude together with MySQL.ttinclude, I get the error "Compiling transformation: The name 'GetSPs' does not exist in the current context". GetSPs is defined for SQLServer and I saw...

How to intersept the save method on ActiveRecord?

Hi! I need to intercept the Save method, do some validations, alter some properties and then let it go again normally. How can I do this? Thanks! Alex ...

Subsonic Error: "Entity Models.Servers' has a property 'Columns' with an unsupported type"

I've been playing with SubSonic lately and I've come across an interesting error. Entity Models.Servers' has a property 'Columns' with an unsupported type When I created a simple ASP.NET application with VS2008, added the reference to SubSonic, created the connection string, and dragged the Active Record files over into the proje...

Subsonic 3.0 Medium Trust Issue

Hi guys, I'm having an issue with running Subsonic in medium trust and don't know if i'm querying wrong - if there is some part of subsonic 3.0.3 that doesn't like medium trust can someone tell me? Someone else posted somethin similar a while ago and there was no real reply on whether it did exist or not (the bug). Rob said it had been ...

subsonic 3 query syntax

Anyone know of a website that shows various Subsonic 3 query types? I used to use various SS 2 sites that would go through examples of how to get varying types of data. However, am now using SS 3 and am new to .net 3.5 so while the SS site does provide three or four example queries it doesn't explain how they work and there aren't enough...

SubSonic vs. Castle ActiveRecord

For an upcoming project C# code needs to be written around a legacy Oracle database. It will be very data centric, because most of the code will deal with data manipulation -- there are almost no business rules. So I decided against a full blown ORM and opted for an Active Record approach. I come across two options: SubSonic and Castle ...

What is the best way to use nested Objects with Subsonic when I only have Iqueryable for Foreign Key Relationships

I'd like to use Subsonic in a shopping cart application, but I'm trying to replace code that is using Session to store an Order object. That Order object has a collection or OrderDetail objects that are added to the collection through the shopping cart process. I'm impressed with what Subsonic can do and I think I'm missing how I could...

How do you migrate existing data with Subsonic migration?

I watched the http://www.subsonicproject.com/docs/Using%5FSimpleRepository screencast, but I am left wondering... how do you migrate existing data? Assume you decided to split a Name property into a FirstName and LastName. How do you do this in Subsonic? ...

Subsonic 3.0.0.3: issues with load slowdowns

Hi. I'm using subsonic 3.0.0.3 (active record) quite a simple database really, have trusted in its abilities but i am really getting let down by how incredibly slow it it to do anything. For some reason it likes to run through things more than once. For example: var newitem = new new_quote_item { quote_id = Convert.ToInt32(newQuoteI...

How do I bulk Insert using SubSonic?

I have something that looks like this foreach (var user in NewUsers) { var dbUser = new User {FirstName = user.FirstName}; dbUser.Save(); } That is too many inserts into the database. Can I do something like? User.BulkInsert(NewUsers); Thanks. ...

InnerJoin with Where Expression trouble

I am using Subsonic 2.1 and I need to do an innerjoin and use a where expression and I keep getting the error: Must declare the scalar variable "@Partner" Here is my code: Dim ds As DataSet = UWP.Model.DB.Select("TOP 30 FirstName, LastName, EmailAddress, CustomerRowID, CompanyName") .From("Customer").InnerJoin("Partner") .W...

How to return a Dataset using Subsonic 3?

Hi...I have some old code that was using Subsonic 1.x and want to migrate to 3. Some of my old methods used to return a Dataset using the old Subsonic Query object and then just calling ExecuteDataset(). I still need to support those methods, since they're called by other code...however, I can't find anywhere how to to a code query with...

Subsonic 3.0 missing output parameter/default parameter support in SQL Server?

I have a stored proc: CREATE PROCEDURE MyProc ( @P1 uniqueidentifier, @P2 int = NULL output, @P3 int = NULL output ) The signature on the C# side should be (Guid P1, int? P2, int? P3) I would think. But it's not, it's just (Guid,int,int). Furthermore, the output params are not created as output params, they're just straight "AddPara...

LINQ Left Join Causes error in SubSonic.Core

I am using the latest version of SubSonic 3 and ActiveRecord. I am trying to do a left join in LINQ. It fails with an error somewhere down in SubSonic. I have a Vehicle object and a VehicleImage object The Vehicle can have multiple images, but it is not required. so a left join is appropriate. This is what I have var ve...

SubSonic 3 doesn't honor schemas for update (fixed)

I am not running Mike's latest code because it does not build and he didn't update the templates to generate code for the new Load with columns he added. So I am one revision back in the source. My database has tables in multiple schemas and they would not update properly. In SubSonic.Query Update.cs I needed to change the constructo...

Why does SubSonic's ActiveRecord T4 template generate ActiveRecord1.cs and not ActiveRecord.cs?

I've used SubSonic's ActiveRecord T4 templates in a couple of projects. Today I added the same templates from one of these projects (without the generated .cs source files) to a new project. For some reason when I run the T4 template code generator, instead of generating: ActiveRecord.cs, Context.cs, StoredProcedures.cs and Structs.cs...

SubSonic 3 and MySQL, removing underscore from column name in CleanUp() method causes exceptions when using property in linq-query.

I've run into a problem when using SubSonic 3(.0.0.3) ActiveRecord with MySQL. Since MySQL doesn't allow you to use uppercase letters in table or column names (or rather disregards it if you do) I decided to separate words using underscores, e.g. entity_id, and then use the CleanUp() method to add title casing and remove the underscores...

How can I automate the t4 code generation for SubSonic

Hi all, I'm using SubSonic 3 (ActiveRecord mode) to generate the code for my DAL. It uses T4 templates (.tt) files that as soon as you save, generate the code for you. I want to automate this as part of my NANT build, but I can't get this to work. I know that MS provide a tool called TextTransform to generate the code from T4 templates...

Subsonic 3 ActiveRecord generation problem

Hi There! I´m newer user in stack overflow and my english i´snt so good i hope you understand my trouble. when I´m compiling my template this archives .cs it´s ok (Context, Structs), but in the ActiveRecord the code comes incomplete. It seems that the system Break de compilation at line 5017 and not return any exceptions to me. my c...

Subsonic Exception - The member 'TestMode' is not supported

Hi! i´m using LINQ with the subsonic in a class to get my data here is the code below: public IQueryable<Veiculo> SelecionaVeiculosSite() { return (from v in _db.Veiculos where v.Ativo == true && v.Marca.Ativo == true && v.M...