Reroute procedures

4 posts, 0 answers
  1. y2kdis
    y2kdis avatar
    9 posts
    Member since:
    Nov 2012

    Posted 21 Mar Link to this post

    Hi,

    What's the idea behind the Reroute procedures (e.g., Reroute_Add, Reroute_SaveChanges) and when should I utilize them?

    Thanks!

  2. Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 23 Mar Link to this post

    Hello,

    Can you give us a bit more context?
    What are the Reroute_Add and Reroute_SaveChanges and how are they related to Telerik Data Access?

    Regards,
    Viktor Zhivkov
    Telerik
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
  3. DevCraft banner
  4. y2kdis
    y2kdis avatar
    9 posts
    Member since:
    Nov 2012

    Posted 29 Mar in reply to Viktor Zhivkov Link to this post

    Hi Viktor,

    You are basically throwing the question back at me. The EntitiesModel of your Telerik Data Access has them in the list of available methods but there's really no documentation about it so we have no idea about their purpose. Too bad there's no way to attach a screenshot here of VisualStudio's Intellisense showing them but you should be able to find out what I'm referring to if you open the file Context.ttinclude or ContextGenerator.ttinclude for VisualBasic and search for 'reroute'.

     

     

     

     

     

     

     

  5. Yavor Slavchev
    Admin
    Yavor Slavchev avatar
    22 posts

    Posted 31 Mar Link to this post

    Hi,

    These methods are generated in your entities model class which inherits from the base class OpenAccessContext and implements the methods of the IUnitOfWork interface at the same time. Since these two have the same method signatures, like SaveChanges, Add, Delete, etc...Visual Basic.NET does not allow to have a method with the same name in the inheritor, unless the base method is marked as virtual or abstract (Overridable or MustInherit in Visual Basic.NET).
    Since most of the methods in the base OpenAccessContext are not virtual or abstract by design, we need to generate similar wrapping methods with the 'Reroute' prefix, implementing the corresponding interface member and invoke the base class implementation inside. Basically it doesn't matter which of the two methods you use (e.g. Add() or Reroute_Add()) - they do the same thing.
    You can look at this StackOverflow thread to see a similar discussion regarding this Visual Basic.NET limitation.
    I hope this information is helpful.


    Regards,
    Yavor Slavchev
    Telerik
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top