SubSonic CreatedBy

I have a CreatedBy column in a table whose datatype is int. SubSonic crashes because of this because it uses CreateBy, CreatedOn, ModifiedBy and ModifiedOn. By columns must be strings.

Is there a way to let SubSonic know that it should ignore those columns?

0


a source to share


2 answers


No, you probably have to rename the column to CreateByUser or something.



You can also change it to nvarchar (50) and create a ModifiedBy column nvarchar (50) and make it work very well.

+1


a source


Yes ... it's quite doable. First of all, show us the code that is causing it to crash. I probably know what it is. You are probably trying to do something like this

MyRecord.Save();

      

If you need to pass in the id of the person creating the aka.



MyRecord.Save(55);

      

SubSonic knows what datatype your columns are, so you don't need to specify what datatype it is. Also, if you look, there are overloads of the Save method, namely Save (int id), Save (string id) and Save (Guid id). So if you are using an int, string, or guid for your CreateBy column, you have to go, you just need to remember the ID as SubSonic expects if you use those columns.

0


a source







All Articles