I'm trying out the new SubSonic 3 preview, but I'm not sure about the patterns I should be using for the basic CRUD operations in my MVC project.
I'm trying to keep as much of my data logic in my models, so I added some static CRUD methods to each model's partial class.
For example, let's say I have a configuration table, which should ...
Hi,
It's Friday so I'm prob doing something stoopid here. In fact I'd put money on it.
I'm playing around with Subsonic - got my feet happily into v2.2 but intrigued by v3 alpha
Followed Rob's webcast, did as he did, watched T4 generate the code, went to use the new namespace and oh. No namespace.
I can see the namespace Test.Data ...
I have a table with a PrimaryKey that is set as uniqueidentifier (GUID) and it's autopopulated using the newsequentialid() function from sql server 2008... When I insert a row manually, everything works as normal. But when I insert the record using the subsonic class and the repository the GUID column defaults to all zero's and the dat...
Hi, could you please describe in just few words state of the Subsonic 3 project? Will you share the sources, when we can expect the release. How are things with development, what problems have you meet and so on...
Thanks a lot!
...
EDIT: There's now a doc page on this so this question is irrelevant, also it's outdated. Read the docs not this question.
I've been toying with the SubSonic 3 code generation for a month or so now and I'm interested in getting some feedback from others on which template they use and why.
EDIT: Rob's been blogging about the different t...
I have a table that holds system users with their last login date and time in it. The admin users of the system need to be able to add users, but when I add the new user record a validation error occurs unless I put a valid datetime in the last login date field.
I've tried manually changing the field to dbnull, null, etc prior to the s...
Issue: the primary key of the base table is named differently than the the key in the fk table.
Subsonic 3 does not know how to handle that, which is fine, its beta. So I was going to change the Html.ControlFor logic to just grab the table and use the pkname from that:
var fk = db.FindTable(col.ForeignKeyTo.FriendlyName);
However th...
I am using Subsonic 3 (T4 template) to generate the models for my mvc app. However the default template does not allow for nullable columns, so when I go to save the record it errors out if a nullable datetime column is blank. (See this post...)
Question: What is the best practice to handle this?
Option 1: Change the template to ch...
Hey guys, I am a little confused as to how to get the T4 templates and use them when you pull down the latest code from SVN for Subsonic 3. Are there any instructions anywhere for this or could someone enlighten me? I looked @ the old alpha release and there was a nice _Generated folder that held all of these files. I'm curious what I...
I'm interested in using Subsonic 3.0 for developing a new ASP.Net MVC application that will be going into production use soon. Would this be a feasible option? Does anyone have an idea when 3.0 is going to be released? Is anyone else using it on a production MVC application?
...
Basically I'd be looking to implement a method like this.
IQueryAble GetQuery<T>(Entities db) or extension method Entities.GetQuery<T>()
This way you could do things like this
public IQueryable<T> GetAll()
{
return yourEntityClasses.GetQuery<T>();
}
which would return a SELECT * FROM query expression and obviously from there you c...
Does the ActiveRecord template files create classes that handle many to many relationships?
...
I have a Pages table, I have a PagesRoles table with PageId, RoleID that links to ASP.Net Membership Roles table and the Pages table.
I want to somehow return a Page that links to the currently logged in User's Roles.
The User may be in more than one role. A Page can have more than one Role against it.
I have a Page class that has a f...
I have a schema like so. Menu->Pages->PageRoles->ASPNetRoles
Menu has a CategoryID.
I want to return all Menu items with a CategoryID of 6.
Some Menu items have a foreigh key of PageID. Pages can have 1 or more roles against them. I can check the currently logged in users roles and make sure that they are in the results by joining the...
The generated SQL does a cross join but as the ID's are matched it acts like an inner join but is there a better performing way to do this by actually using the join keyword in C#? Is there a way where you don't have to specify how the properties join because they are all heirarchicly related anyway
Item is a Page class
PageRoles is an...
I'm starting an ASP.NET MVC project using SubSonic 3 ActiveRecord. I added a table Users with a primary key ID and recompiled T4 files to generate User class.
I want to make sure that, as I go along with the development, I can regenerate/migrate the database at any point. It looks like I have to create tables and relationships in the da...
Is there any way that I can access my SQL views in SubSonic 3.0? The code generation seems to skip views altogether
...
Hi
I have a SP (shortened version):
CREATE PROCEDURE [dbo].[usp_ADMIN_CountExposure]
@whereAge int
,@whereGender int
,@whereSalary int
AS
BEGIN
SET NOCOUNT ON;
DECLARE @query varchar(max)
SET @query = 'SELECT [ID], SUM([Lives]) AS [Lives]
FROM [ExpDB].[dbo].[Ex...
Are there the asp.net scaffolding controls (ex: < subsonic:QuickTable />) still available in subsonic 3?
...
While using SubSonic 3 with ActiveRecord T4 templates, the generated code shows many warnings about CLS-compliance, unused items, and lack of GetHashCode() implementation.
In order to avoid them, I did the following modifications:
// Structs.tt
[CLSCompliant(false)] // added
public class <#=tbl.CleanN...