Re: Using a custom interface.

Re: Using a custom interface.

Old forum URL: forums.lhotka.net/forums/t/2104.aspx


sashidhar posted on Tuesday, January 09, 2007

I am kinda new to CSLA, so...the following can as well be put into the "Silly/Stupid" question category.

How do I define an interface using csla ?

Using a base class would solve the problem, but I wanted to see how I can declare and inherit from an interface while using clsa?

 

Thanks in advance,

Sashidhar Kokku

 

ajj3085 replied on Wednesday, January 10, 2007

You define and implement interfaces in your Csla based objects just as you would normally.

Sometimes its helpful to have your interface specify that one of the Csla interfaces be implemented as well. 

For example:

public interface MyInterface : Csla.Core.IEditableBusinessObject {
   // interace members
}

Then anything which implements MyInterface must also implement IEditableBusinessObject.  Normally that would be the case, because your BO would subclass BusinessBase.

ColourHaze replied on Thursday, December 05, 2013

Hi,

A response to a quite old question, however this was the only post I could find.

Inheriting from the core interface was not really the issue, however it results in some methods that might not want to be exposed:

Any thoughts on what is the best way to handle this?

Best regards,

Peter

JonnyBee replied on Thursday, December 05, 2013

Hi,

Other than to look for maybe another interface higher in the hierarchy then no.

You _can_ implement the methods explicitly so that they are only available when you use the interface (cast) but once it is defined in the interface the methods/properties have to be implemented and available.  

Copyright (c) Marimer LLC