Help using stored procedure in UnitOfWork

Posts   
 
    
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 11-Aug-2005 12:10:07   

Hi,

I need some help with adding a stored procedure call to a unitofwork.

My original call to the SP is:


ActionProcedures.InsertReading(Reading.ObjNo1, Reading.ObjNo2, Reading.ReadingDate, Reading.ProjectNo,  ref returnValue, null)

How can I add this to my UnitOfWork, this is what I have, but I don't know what to do with the parameters...


uow.AddCallBack(new ActionProcedures.InsertServiceMeterReadingCallBack(ActionProcedures.InsertServiceMeterReading), UnitOfWorkCallBackScheduleSlot.PreEntityDelete, true, ................

Please help me...

Gr.,

G.I.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 11-Aug-2005 12:31:21   

As stated in the documentation ("Unit of work and field data versioning - UnitOfWork usage: stored procedures"), simply specify the parameters at the spot where your .....'s are:


uow.AddCallBack(new ActionProcedures.InsertServiceMeterReadingCallBack(ActionProcedures.InsertServiceMeterReading), UnitOfWorkCallBackScheduleSlot.PreEntityDelete, true, Reading.ObjNo1, Reading.ObjNo2, Reading.ReadingDate, Reading.ProjectNo, ref returnValue);

Frans Bouma | Lead developer LLBLGen Pro
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 11-Aug-2005 13:18:04   

hehe, i figured out that, but you may call me stupid, but I don't know how to add these parameters, it says Params object [] Parameters. What object is this, and how do I add my parameters of different types to this.

I mean, is it something like the SQL Parameters, is it exactly this? Does it mean I have to create different source code for different databases here? How exactly do I do this?!?

Marcus avatar
Marcus
User
Posts: 747
Joined: 23-Apr-2004
# Posted on: 11-Aug-2005 16:28:08   

G.I. wrote:

hehe, i figured out that, but you may call me stupid, but I don't know how to add these parameters, it says Params object [] Parameters. What object is this, and how do I add my parameters of different types to this.

I mean, is it something like the SQL Parameters, is it exactly this? Does it mean I have to create different source code for different databases here? How exactly do I do this?!?

params is C# keyword... (Don't know about VB.NET)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 11-Aug-2005 18:28:19   

G.I. wrote:

hehe, i figured out that, but you may call me stupid, but I don't know how to add these parameters, it says Params object [] Parameters. What object is this, and how do I add my parameters of different types to this.

I mean, is it something like the SQL Parameters, is it exactly this? Does it mean I have to create different source code for different databases here? How exactly do I do this?!?

No, it's a .NET thing simple_smile when you see params as extra keyword, you know you have the ability to specify whatever amount of parameters you want, from 0 to whatever you need. You can just specify them as if they were declared in the method signature simple_smile

(I believe in VB.NET it's also Params, or that it is done transparently. You can consume these methods in vb.net without a problem.)

Frans Bouma | Lead developer LLBLGen Pro