This is a migrated thread and some comments may be shown as answers.

Reroute procedures

3 Answers 45 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
y2kdis
Top achievements
Rank 1
y2kdis asked on 21 Mar 2016, 11:01 PM

Hi,

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

Thanks!

3 Answers, 1 is accepted

Sort by
0
Viktor Zhivkov
Telerik team
answered on 23 Mar 2016, 01:55 PM
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.
0
y2kdis
Top achievements
Rank 1
answered on 29 Mar 2016, 05:14 PM

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'.

 

 

 

 

 

 

 

0
Yavor Slavchev
Telerik team
answered on 31 Mar 2016, 07:43 AM
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.
Tags
General Discussions
Asked by
y2kdis
Top achievements
Rank 1
Answers by
Viktor Zhivkov
Telerik team
y2kdis
Top achievements
Rank 1
Yavor Slavchev
Telerik team
Share this question
or