subsonic3

Subsonic 3, MySQL T4 template: Structs.tt fails

Hi, Can anyone help? When I try to generate my Structs.cs file, the process is failing with the error, becuase the SchemaName is not being returned by MySQL provider. " Error 3 Running transformation: System.ArgumentNullException: Value cannot be null. Parameter name: objectToConvert at Microsoft.VisualStudio.TextTemplating.ToStr...

Problem with RunMigrations in SimpleRepository Example - Subsonic 3

I downloaded today Subsonic 3 and tried out the examples. I am having a problem with the SimpleRepository example and I wondered if anyone else has had this. In the HomeController there is a defintion as follows: public HomeController() { _repo = new SimpleRepository("Blog"); } I wanted to enable the migrations an...

Subsonic SimpleRepository problem with Category.All

I have a problem with the Create View in the SimpleRepository example in Subsonic 3. I get an error at line (28): <%=Html.DropDownList("CategoryID",new SelectList(Blog.Category.All(), "categoryid", "description")) %> Basically, .All() is not known. Does anyone have a solution to this? Not that should make a difference for this error ...

Is there any demo to insert a new record into a table with identity primary key using Subsonic 3?

please show me a demo. Thanks. ...

Subsonic 3 Active Record Testing

Using the new built in testing for Active Record (set "Test" as the connection string) I've hit a problem performing an update. The code I'm testing pulls an existing object out of the database, makes some changes to it, and then saves it. public void SaveProduct(string productId) { var dbProduct = Model.Generated.Product.SingleOrDefa...

Subsonic 3: Invalid cast from 'System.Byte' to 'System.Byte[]'.

I'm trying to use Subsonic 3.0 but with every query I try it gives me this error: "Invalid cast from 'System.Byte' to 'System.Byte[]'." I've tried using linq and activerecord on several different tables and always having this problem. Just to make sure, here is a code snipped that throws the error: LiteralContent.Text = DB.Teksten.Sin...

Subsonic 3 getpaged filter question

I am sure this is a stupid question, but how would I get a pagedlist of filtered items? Here is how I ended up doing it: PagedList<Company> company = Company.GetPaged(1, 10); var list = Company.Find(x => x.CompanyName.ToLower().Contains(query.ToLower())); company .Clear(); foreach ...

Subsonic 3 Linq Projection Issue

OK I'm banging my head against a wall with this one ;-) Given tables in my database called Address, Customer and CustomerType, I want to display combined summary information about the customer so I create a query to join these two tables and retrieve a specified result. var customers = (from c in tblCustomer.All() ...

Subsonic not working with MySQL (5.0.51a)

I am trying to use Subsoinc 3.0.0.1 to connect to mysql db. I added dll reference and connection string to app.config Then I copied templates from ActiveRecord folder to folder in my solution and edited namespace and connection string but then i get this error: Error 10 Running transformation: System.Data.SqlClient.SqlException: A...

Subsonic 3 - What is the difference between these approaches?

This method works fine: Person p = new Person(3); p.Name = "Bob"; p.Update(); However if I have an IQueryable foreign key collection the below fails var foreignItems = Person.Find(x => x.ID == 3) foreach(Person p in foreignItems) { p.Name = "Bob"; p.Update(); /*THROWS EXCEPTION */ } Exception is thrown in Repository Update as i...

SubSonic SimpleRepository - Default Value

Hopefully there's a solution/patch to SubSonic SimpleRepository where I can specify a column/property with a default value so that it populates the DB with the default value set. I'm still reading the SubSonic Docs and just ran across that issue. Maybe someone has an answer/solution for this that I can start using. ...

subsonic with support for caching

Having a project with following requirements in mind. data reading intensive application. 100 max concurrent users a times. Application have very high Though data is huge it is getting modified only once a day Decided to use subsonic cause of ease of development and potential to work in high traffic environment. Though few things ...

SubSonic3 SimpleRepository - Create View Causes 'SubSonic.Linq.Structure.Query`1 Error

I have setup a new ASP.NET MVC project and followed the SimpleRepository tutorial by: Adding the reference to SubSonic.Core (v3) Created a simple POCO - PhoneType Created the controller and injected the SimpleRepository Created the "Create" view When I ran the sample, I get the following error: The model item passed into the dict...

WPF Binding in SubSonic 3 to Foreign Keys

In WPF and SubSonic 2 using Active Record, I was able to bind to properties in rows from one table and easily follow the foreign key references (properties that returned the foreign key row representation) to bind to fields in the foreign key table. With SubSonic 3 and ActiveRecord, I'm not quite sure how to do this (easily) anymore. I...

Subsonic 3.0 and SqlHierachyID

I am having trouble with Subsonic 3.0 generating an object for a table which contains the new HeirachyID datatype. From what I have found, there is no corrosponding .Net type, and subsonic doesn't seem to know how to handle the hierachyid data. Error that is thrown: Object of type 'Microsoft.SqlServer.Types.SqlHierarchyId' cannot be...

Relationships and Lazy Loading in SubSonic 3.0

Hello, I'm playing around with SubSonic 3.0 at the moment, and it looks really straight-forward (except that I still have to decide between SimpleRepository and ActiveRecord, but that's another story). However, as the documentation is a bit sparse, I am not sure if it supports foreign-relationships and lazy-loading. Essentially, I have...

Subsonic 3: SimpleRepository. How to map enum to a table column

I have a DB table (Profile) to describe a person. This table has a column "Sex" (int). In .NET part I have: public enum Sex { Male = 1, Female = 2 } public class Profile{ public int ID {get; set;} public Sex Sex {get; set;} } ... SimpleRepository _repo = new SimpleRepository("ConnectionString"); _repo.Add<Profile>(profile); ...

QuerySurface Template?

Hello, i've been wondering for few hours now how can i get the QuerySurface integrated in my project. I am using the SubSonic 3.0 ActiveRecord T4 templates with great success, As i have been doing query with LINQ, i need also the Update, Insert and Delete functionality which according to the documentation utilize QuerySurface. http:...

DataProvider = ProviderFactory.GetProvider("") NullReferenceException?

I am getting a NullReferenceException when SubSonic calls the default contructor for my database. In my case the line it errors on is. DataProvider = ProviderFactory.GetProvider("MDMA"); I have the namespaces set correctly and the classes seam to be getting generated correctly, so it looks like I can connect to the database. Is this ...

Null Reference Excepion when saving data on subsonic 3

I am testing subsonic 3, i can query my database but when i am inserting a record i have an exception. Here is my code: Client lClient = new Client(); lClient.Name = "Peter"; lClient.FullName = "Richards"; lCliente.Save(); And i have a null reference exception on this generated code: var newKey=_repo.Add(this,provider); Any help is a...