AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Root object Transactional attribute - enhancement to allow users to control transactions in partial methods. #488

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. If you generate a root object, the dataportal methods get decorated with the 
<Transactional(TransactionalTypes.TransactionScope)> attribute. 
2. If you want to override the root data portal methods with different 
transactional requirements you can't, via the partial methods.

What is the expected output? 
1. Remove the <Transactional(TransactionalTypes.TransactionScope)> from the 
DP_xyz method. 
2. Add a "Using scope As New Transactions.TransactionScope" to the generated 
code.

Example:
'   Blake this would allow the users to overwrite transactional requirements if 
need by using the partial methods. (just a little more flexible).
            Using scope As New Transactions.TransactionScope
                Using connection As New SqlConnection(ADOHelper.ConnectionString)
                    connection.Open()
....

End Using ' Connection
End Using ' TransactionScope

What version of the product are you using?
v3.0.0.1817

Original issue reported on code.google.com by JenasysD...@gmail.com on 12 Aug 2010 at 1:27

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 16 Aug 2010 at 2:23

GoogleCodeExporter commented 9 years ago
Hello,

I don't think this is a good choice as the framework is looking for this 
attribute and applies it automatically (already managed for you). I think a 
better approach would be to have this a generation time property where you 
select what transaction type you want to use.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 17 Aug 2010 at 10:39

GoogleCodeExporter commented 9 years ago
Hello,

What do you think?

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 17 Aug 2010 at 10:40

GoogleCodeExporter commented 9 years ago
Hello,

We will add an property to select the different attributes in a future release.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 24 Aug 2010 at 5:42