Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Generated code> EntityBase2 BeginEdit() method
 

Pages: 1
Generated code
EntityBase2 BeginEdit() method
Page:1/1 

  Print all messages in this thread  
Poster Message
fire_starter
User



Location:

Joined on:
30-Aug-2010 11:52:25
Posted:
64 posts
# Posted on: 08-Sep-2010 15:30:42.  
Hello

When trying to compile my project, i get the following error at this line of code:

Code:
if (m_BindingManager.Current is EntityBase2) ((EntityBase2)m_BindingManager.Current).BeginEdit();


This used to work fine, but I currently migrated the project from .Net Framework 1 to .Net Framework 3, and so from LLBLGen v1 to LLBLGen v3.

Do you have any idea on how this has to be changed?
Thank you
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
13698 posts
# Posted on: 08-Sep-2010 16:18:24.  
You haven't mentioned the error. Regular Smiley

  Top
fire_starter
User



Location:

Joined on:
30-Aug-2010 11:52:25
Posted:
64 posts
# Posted on: 08-Sep-2010 16:37:58.  
Sorry, I forgot to mention it.

So, the error message was:

'SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2' does not contain a definition for 'BeginEdit' and no extension method 'BeginEdit' accepting a first argument of type 'SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2' could be found (are you missing a using directive or an assembly reference?)    D:\ASTech2\astech.office\trunk\ListFormManager.cs    2978    90    ASTech.Office

  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
34651 posts
# Posted on: 09-Sep-2010 09:53:07.  
As BeginEdit is a member of the interface 'IEditableObject' we've implemented it explicitly to free up the public api in intellisense.

So cast to IEditableObject instead of EntityBase2


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



Location:
Baton Rouge, LA
Joined on:
20-Aug-2008 17:24:31
Posted:
66 posts
# Posted on: 12-Feb-2012 17:16:42.  
I rely on BeginEdit, EndEdit, and CancelEdit for my editor dialogs. Would the following be a workable solution to give me backwards compatibility from 3.1 to 2.6 so that
1. I do not have to cast.
2. Interfaces that I have created which have these methods as part of their interface do not have to be re-worked.


In the CommonEntityBase class:

// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode    
        public void BeginEdit()
        {
            ((IEditableObject)this).BeginEdit();
        }
        public void EndEdit()
        {
            ((IEditableObject)this).EndEdit();
        }
        public void CancelEdit()
        {
            ((IEditableObject)this).CancelEdit();
        }
Billy Jacobs  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
13698 posts
# Posted on: 13-Feb-2012 10:26:07.  
Seems fine, I encourage you to test it, to see if it goes smoothly or not.

  Top
KerryKilgour
User



Location:
Ottawa, Canada
Joined on:
02-May-2012 21:51:20
Posted:
34 posts
# Posted on: 02-May-2012 21:57:09.  
Walaa wrote:
Seems fine, I encourage you to test it, to see if it goes smoothly or not.


Just upgrading from 2.6 to 3.1...when I try the code above, with these methods or other properties, it goes into an infinite loop/stack overflow exception.

        public void BeginEdit()
        {
            ((IEditableObject)this).BeginEdit();
        }

Any suggestions, other than adding casts all over...?
Kerry Kilgour  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
7618 posts
# Posted on: 03-May-2012 07:23:52.  
I don't see why would you obtain an stackoverflow. Please post more information:
- LLBLGen runtime library version (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725)
- Full exception message and stack trace
- Relevant code. i.e. Where are you putting that code and how are you calling it.


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


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

Version: 2.1.12172008 Final.