SubSonic 3 has been a huge recode of the core, using some new techniques such as T4 instead of it's own templates and providing a linq query engine.
But most of the good old features, like the query tool, are still available.
If you did this:
var p = new Product();
p.ProductName = "new product";
p.Save();
or this
var p = DB.Select()
.From<Product>()
.Where(Product.ProductCode).IsEqualTo("1234")
.ExecuteSingle<Product>();
this will still work with SubSonic3
If you are brave enough my suggestion for an upgrade path would be this:
- Make sure your DAL uses "generatenullableproperties=true"
If not recreate it and fix possible compiler / runtime exceptions:
if (p.QuantityHasValue) p.Total = p.Quantity * p.Price;
// changes to
if (p.Quantity.HasValue) p.Total = p.Quantity * p.Price;
Change the Namespace of you generated file from Your.Namespace.DAL
to Your.Namespace.LegacyDAL
- create the DAL with the ActiveRecord templates in your old namespace
- If you used InlineQuery, the class name changed to CodingHorror
- fix all compiler errors (maybe the generated property names / types differ a bit)
- rewrite queries if needed
- if you are using subsonic migrations: Stick with them since there is no coequal replacement in SubSonic3
- test, test, test!!! until everything works fine
- make use of the subsonic3 features (such as linq) only for new tasks