Passing a BusinessObject by reference


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I want to pass a BusinessObject by reference into a method, as I want the BO changed in the method, and the resultant chnged BO available in the calling routine. I have set up a very simple method for illustration purposes(does not do anything)

TestMethod(ref KernelBaseSF.KernelBO myBO)
{ int x;  x=1}
(KernelBaseSF.KernelBO is my Subclass of the MicroFour.StrataFrame.Business.BusinessLayer)

 Now, the following does NOT give a compile error:
KernelBaseSF.KernelBO bo = new KernelBaseSF.KernelBO();
KEK001.TestMethod(ref bo);
However, if I try to use a BO thats dropped on the form as in:
KEK001.TestMethod(ref this.KmaBO1) 
 I get an Error 6 The best overloaded method match for 'KEKCommon.KEK001.TestMethod(ref KernelBaseSF.KernelBO)' has some invalid arguments C:\KEK\Kernel_App\Scp_Maint.cs 242 13 Kernel_App


If I just take out the ref parameter in the calling and called methods,it compiles ok, so it looks like there is an issue, for calling by ref, of a BO dropped on the form
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ger Cannoll - 13 Years Ago
Edhy Rijo - 13 Years Ago
Ger Cannoll - 13 Years Ago
Edhy Rijo - 13 Years Ago
Ger Cannoll - 13 Years Ago
                         [quote][b]Gerard O Carroll (8/30/2011)[/b][hr]I have re-engineered my...
Edhy Rijo - 13 Years Ago
                             Hi Gerard, Looking at the DevExpress videos I came across to this one...
Edhy Rijo - 13 Years Ago
                                 Not sure this would help, but here is an Infragistics inherited Grid I...
Ivan George Borges - 13 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search