Hi guys how do you implementing an Audit Trails on all objects/class on SubSonic under Data Access Layer?
If what I want is, all changes on all objects will be recorded on a single table/object.
public class AuditTrail
{
public int Id { get; set; }
public string SourceObjectName { get; set; }
public int RowPK { get; set; } // ...
How ca I use Subsonic's Find<T> method to search for rows with a field containing the "null" value. For the sake of the discussion, let's assume I have a c# class called "Visit" which contains a nullable DateTime field called "SynchronizedOn" and also let's assume that the Subsonic migration has created the corresponding "Visits" table a...
is this a bug? my property of type bool from a bit field on SQL DB, always return (false), even though the value on the Database is (true).
although altering the property to true or false seems to be working, if you look at the database/table, the only problem is the fetching... return always "false"
I am using
- subsonic-SubSonic-3.0...
3003 is the exact version I think. Anyway, I have the below code (using ActiveRecord) for creating 2 new entities, deleting any that have the same "Stamp1" and "Stamp2" values, and then I want to insert everything in my List. I cannot tell if the code is efficient for the delete, and I have no idea how to insert everything new from a lis...
Hi All,
I'm trying to get eager loading working with Subsonic, and it's been returning null for me.
In the method below, I'm trying to hydrate a domain model (UserModel) which contains another domain model (CompanyModel). However, with the code below, UserModel.Company is always null.
What am I missing here. Any help would be appre...
Hi,
I am ready and see all the tutorials and videos to configure the subsonic 3.0.0.3 with MySql and fail to genarate the ActiveRecords.cs. I use the MySQL.ttinclude in the folder to generate the class but it is still not working. I rename all the refenreces to SQLServer.ttinclude to MySQL.ttinclude and it still does not work. The error...
Hello everyone,
I've been using Sub Sonic 3.x.x.x and i've come across something i need help with.
I'm using an abstract class and a factory pattern etc..
and this is basically the problem:
public abstract class Person
{
}
public class Male : Person
{
}
public class Female : Person
{
}
....
how do i get this to work
String personTy...
Hey there,
I've got a pretty basic setup in Visual Studio 2008 - Website project referencing my Class library project. SubSonic 3 is referenced from both projects, but the Template has been modified for my MySQL db. It connects and generates the most of code (Accept for StoreProcs for some reason), and the namespace is there, and my ...
I'm getting an SqlException when I call Find() on a non-primary key field. I only experience this when I make this call in VB.
Details:
SubSonic 3.0.0.3 and ActiveRecord
Visual Studio 2008 solution
SubSonic and T4 templates in a C# class library project
My VB application in a separate project referencing the SubSonic project
In m...
this codes works fine on SQL Express 2008:
return _repository.GetInstructions()
.Where(x => x.PublishedDate != null)
.OrderByDescending(x => x.PublishedDate)
.First();
but when run using SQL Server 2000 , it breaks.
here is the error. I'll post the trace if someone wants to see it.
FailedSystem.Data.SqlC...
I have a query that works fine when using an anonymous type but as soon as I try to un-anonymize it it fails to select all values into the class.
here is the linq i'm using (in combination with Subsonic 3):
var producten = (from p in Premy.All()
join pr in Producten.All() on p.dekking equals pr.ID
where p.kilometragemax >= 10...
Hi folks,
I am currently using a Linq template with SubSonic3 to create my models. I have a simple Member class, which has a collection of Notes. A Note class has a PublishedDate and Title properties.
I have a UserControl which has a collection of Members for its DataContext. There are two ListBoxes and a bunch of TextBoxes and other c...
I'm getting a familiar Timeout SqlException when I add a lot of new records quickly using Subsonic ActiveRecord and Sql Server.
Timeout expired. The timeout period
elapsed prior to obtaining a
connection from the pool. This may
have occurred because all pooled
connections were in use and max pool
size was reached.
I hav...
I am struggling pulling a simple list of records from one table object and printing them out.
I have a table called [Acceptance] that has four fields, two of which allow nulls. Here is the ddl for the schema object:
CREATE TABLE [dbo].[Acceptance](
[AcceptanceID] [int] IDENTITY(1,1) NOT NULL,
[AcceptanceCode] [nvarchar](2) NOT...
Is there any way to tell SimpleRepository not to include certain properties/Fields on Update()/UpdateMany()?
Alternative also is "Only properties with changes are to be updated".
...
I'm using Subsonic 3.0.0.3 for a new project and on one of my pages I'm wanting to display only 5 records that are the top 5 read records. My SQL select statement is
select top(5) * from myTable order by reads desc
Is this possible to do with ActiveRecord? If it is I haven't came across how yet.
Jon
...
I just hooked up Subsonic to MySql for the first time. Everything seems to be cool except a simple:
wp_1_post.All().ToList();
throws:
Object of type 'System.UInt64' cannot be converted to type 'System.Int64'.
It looks like the ID column in the wp_1_posts table is an unsigned bigint, just not sure what to do about it...
...
Hi there,
I am not sure how to go about this. I am looking to join columns of two tables together so that instead of just getting a foreign key back, I can display a name that is on the same row as the foreign id.
I did something like this but I kept getting an error about my primary key:
SqlQuery test = db.Select.From().InnerJoin(fi...
I have a gridview control on a page where I need to do a join query. I've written the LINQ query like so:
from v in view_result.Find(f => f.user_id == Session["username"].ToString())
join od in article.All() on v.article_id equals od.article_id
orderby v.view_date descending
select v;
I can't figure out how to write it in the other su...
Hi
I'm trying the following code
UserDetail ud = UserDetail.SingleOrDefault(u => u.UserName == CurrentUserName);
if (ud == null)
ud = new UserDetail();
Address uAddress = ud.AddressId.HasValue
? Address.SingleOrNew(a => a.Id == ud.AddressId)
: new Address();
using (TransactionScope tc = ...