This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Lightspeed: 5.02587.0 Database: Mssql 2008 Hi, When a lightspeed model contains only Stored Procedures, the UnitOfWork class becomes internal.
Is this by design? Regards |
|
|
Yes - the UnitOfWork is there to provide a scope in which entities are tracked nominally relating to a business transaction. We generate the typed UnitOfWork as internal if there are publically visible entities (having no entities in your model also fits this description). If you have a UnitOfWork containing only scalar or non query based stored procs then there should be no cause to use the UnitOfWork as a scope or to query against from an entity perspective which is why we want this to to be marked as internal. If you want to expose the calls to the stored procs to a wider scope you can call via a helper class in the same assembly which can instantiate the UnitOfWork and make the method call. Alternatively if you dont like this default you can change this in the code generation templates, specifically you will want to edit DataContext.vm which is where we generate the typed UnitOfWork. Here is a blog post which describes how to use custom templates in your project - https://www.mindscapehq.com/blog/index.php/2009/09/16/customising-lightspeed-entity-templates/
|
|