subsonic3

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 3 Class Table name generate issue

Hi everyone! i´m a novice in the Subsonic, and i have a isseu about the way how it work´s. When subsonic generate de .cs file for default the name of the classes comes in LowerCase. I have edited the MySql template using the funciton "ToTitleCase()" it´s resolved a peace of my problem, if my table name is Products i´ts ok, but if is t...

Subsonic 3 Foreign Key with Class relationship issue

Hi Everyone! 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 && ...

Subsonic 3 Linq Documentation

I'm started looking at Subsonic just yesterday and having trouble figuring out how to do even the most basic tasks. I've watched the demos for ActiveRecord and SimpleRepository, but they don't fit what we want so I'm trying to use the Linq Templates. The getting started guide for Linq walks through enough to do a query, but how do I ...

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

SubSonic crash with MySQL provider

I'm using Subsonic 3.0.0.3 with ActiveRecord, running against a MySQL database. I'm finding that this works fine: // Approach 1 var db = new testDB(); db.Insert.Into<company>(c => c.name) .Values("Acme") .Execute(); But this crashes: // Approach 2 company c = new company(); c.name = "Acme"; c.Save(); The crash is not immediate...

Re-use of database object in sub-sonic

Yet another newbie SubSonic/ActiveRecord question. Suppose I want to insert a couple of records, currently I'm doing this: using (var scope = new System.Transactions.TransactionScope()) { // Insert company company c = new company(); c.name = "ACME"; c.Save(); // Insert some options company_option o = new compan...

Benchmark Linq2SQL, Subsonic2, Subsonic3 - Any other ideas to make them faster ?

I am working with Subsonic 2 more than 3 years now... After Linq appears and then Subsonic 3, I start thinking about moving to the new Linq futures that are connected to sql. I must say that I start move and port my subsonic 2 with SubSonic 3, and very soon I discover that the speed was so slow thats I didn't believe it - and starts al...

calculate distance with linq or subsonic

i have this MySQL statement from a search page, the user enters there postcode and it finds the nearest stiocklist within 15 MIles of the entered postcode. SELECT * , ( ( ACOS( SIN( "+SENTLNG +" * PI( ) /180 ) * SIN( s_lat * PI( ) /180 ) + COS( " + SENTLNG +" * PI( ) /180 ) * COS( s_lat * PI( ) /180 ) * COS( ( " + SENTLANG + " - s_ln...

Incremental development with subsonic

I'm in the process of starting up a web site project. My plan is to roll out the site in a somewhat rudimentary form first and then add to the site functionality along the way. I'm using Subsonic 3 for my DAL, and I'm expecting the database will go through multiple versions as the sites evolve. This means I'll need some kind of versioni...

Left Join in Subsonic3

Hi there, I'm new in subsonic3, and I'm getting some errors when I try to use LeftJoin var q = from c in categories join p in products on c equals p.Category into ps from p in ps.DefaultIfEmpty() select new { Category = c, ProductName = p == null ? "(No products)" : p.ProductName }; The error is "System.Collec...

SubSonic and Azure Compatibility

I have an application that's due to be rolled out in May. I just took over the project and dumped EntityFramework 1.0 in favor of SubSonic. (We don't have the time to wait for EF 4.0.) There is the possibility of moving the application to Azure, and I was wondering what the implications of that might be. My understanding is that EF 4.0 ...

Saving record in Subsonic 3 using Active Record

I'm having trouble saving a record in Subsonic 3 using Active record. I've generated my objects using the DALs and tts and everything seems fine because the following test passes. I think that my connection string is correct or the generation wouldn't have succeeded. [Test] public void TestSavingAnEmail() { ...

Subsonic Simplerepository GetPaged<T> Enum issues

At one point, SimpleRepository didn't support enums. If you had a POCO object with an Enum it wouldn't persist correctly, you had to have a backing variable which you would use eg: public enum Color { Red = 1, Blue = 2 } public class Car { [SubSonicIgnore] public Color CarColor { ...

Subsonic 3 - Object of type 'System.UInt64' cannot be converted to type 'System.Boolean'.

Hi! i´m using subsonic 3 trying convert a SQL2008 project to MySQL. when the projects try execute this LINQ query : public IQueryable<Marca> SelecionaMarcas() { try { return (from mc in _db.Marcas where mc.Ativo == true ord...

Using Subsonic 3.0 With Silverligh

I am writing a silverlight Line of business application and wanted to use the Subsonic DAL. The Silverlight Project will not allow me to Add the Subsonic reference with the followng error "You can not add the Subsonic.Core.Dll as it was not built against the Silverlight Runtime". I assume that I could create a webservice and add the Su...

SubSonic 3 issue creating List<>

I have an application that requires we use distinct user connection strings per user. We are trying to upgrade from SubSonic 2.x to 3.0. I'm running into issues with trying to create a List<> of objects. When I try to create a List like this: List<table_name> oList = table_name.All().Where(tn => tn.table_id == TableId).ToList(); I ...

Atomically increment a field using SubSonic 3 ActiveRecord.

I'm tring to increment a field in a MySQL database using SubSonic 3 ActiveRecord. In SQL, this is what I'm after: UPDATE people SET messages_received=messages_received+1 WHERE people_id=@id_to; I tried the following, but it didn't seem to work (messages_received always seemed to be 1): _db.Update<person>() .Set("messages_receive...

Fixes for problems with SubSonic 3's TestRepository

I've been trying to use SubSonic 3.0's test repository support for unit testing but encountered a few issues, so I thought I document them, and the fixes I've come up with: Auto-Increment Columns Don't Work Obviously with no DB, auto-increment columns don't work automatically, but if like me you're using simple ints or longs for all id...

Subsonic 3, MySql, System.Collections.Generic.KeyNotFoundException

[WebMethod] public string GetAuthToken(string username, string password) { var db = new LogicDB(); //var results = from u in db.Users // where u.Username == username && u.Password == password // select u; User u = db.Select .From<User>() .W...