Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Architecture> Generated entity in .net 4.5.1 having internal constructor
 

Pages: 1
Architecture
Generated entity in .net 4.5.1 having internal constructor
Page:1/1 

  Print all messages in this thread  
Poster Message
Vivek30
User



Location:

Joined on:
30-Jun-2016 15:22:47
Posted:
28 posts
# Posted on: 22-Aug-2016 08:01:49.  
I'm using llblgen pro version 2.6 with .net 3.5 and one of the entity has all its constructors as public but when I'm migrating the .net framework to 4.5.1 then the same entity gets generated with all constructors as internal. I can share my .lgp file or any structure that is required. Is there any alternative way to control the access specifier of constructors of generated entity through .lgp file?

LLblgen Pro version 2.6
.Net Framework 4.5.1
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37237 posts
# Posted on: 22-Aug-2016 09:39:50.  
Is the entity marked as abstract? v2.6 doesn't support .net 4.5 by itself btw, as in: it doesn't have specific code for .net 4.x

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Vivek30
User



Location:

Joined on:
30-Jun-2016 15:22:47
Posted:
28 posts
# Posted on: 22-Aug-2016 10:08:10.  
No, The entity is partial.

If I'm manually changing the internal access specifier of generated code to public then llblgen pro is working perfectly with .net 4.5.1
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14429 posts
# Posted on: 22-Aug-2016 17:56:57.  
Was the entity marked as Abstract in the LLBLGen Pro Designer?

  Top
Vivek30
User



Location:

Joined on:
30-Jun-2016 15:22:47
Posted:
28 posts
# Posted on: 23-Aug-2016 06:33:44.  
Yes, In llblgen pro it is having IsAbstract true.
  Top
Vivek30
User



Location:

Joined on:
30-Jun-2016 15:22:47
Posted:
28 posts
# Posted on: 23-Aug-2016 07:00:12.  
I just now tried marking IsAbstract as false and I could see that now the constructor is public and havent observed any issues so far.

My question is, this entity was always abstract so does .net framework 3.5 and 4.5.1 treats an abstract entity differently.

Also by making this entity as non-abstract what could possibly be the consequences(worst case scenario).



  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37237 posts
# Posted on: 23-Aug-2016 09:57:03.  
Vivek30 wrote:
I just now tried marking IsAbstract as false and I could see that now the constructor is public and havent observed any issues so far.

My question is, this entity was always abstract so does .net framework 3.5 and 4.5.1 treats an abstract entity differently.

If the entity is marked abstract, it always is generated with internal constructors. This is for .NET 1.x and .NET 2.x in v2.6's standard templates. I don't know why the constructors weren't internal before, the templates are generating the constructor as internal for abstract entities.

Quote:

Also by making this entity as non-abstract what could possibly be the consequences(worst case scenario).

Nothing bad, it's however now possible to create an instance of that entity and save it to the DB. If you don't want developers to do that, you should keep marking the entity as abstract. That's the reason why the constructors are internal: the entity is abstract and therefore can't be directly created. The class isn't marked 'abstract' as one can fetch entities of that type as all subtypes are of that type.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.