How to handle non-CRUD data access method when using DataFactory?

How to handle non-CRUD data access method when using DataFactory?

Old forum URL: forums.lhotka.net/forums/t/10051.aspx


Gort posted on Wednesday, February 09, 2011

I am using a DataFactory (ObjectFactory) for my data access layer.  I now have a need for a custom method that accesses the database to do some database tasks.  How would I got about this?  I'd like to keep all of my data access code in the same project but not sure how I would call the method from my business object.

Any help would be appreciated.  Tks.

JonnyBee replied on Wednesday, February 09, 2011

Hi,

Without specific knowledge about your needs, this is exactly what a CommandObject (CommandBase) is supposed to do.

That is, to do data access that is not part of a CRUD operation.  For "lookups" you may also consider to use a ReadOnlyList/ReadOnly object.

 

 

Gort replied on Thursday, February 10, 2011

I simply want to call a scalar stored procedure.

JonnyBee replied on Thursday, February 10, 2011

That makes CommandObject the correct type.

Gort replied on Friday, February 11, 2011

Thanks for pointing me in the right direction.  Have things working now.

Copyright (c) Marimer LLC