![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Abstract class as ServiceContract Is there any way to use a pure abstract class rather than an interface as a ServiceContract? I get runtime errors when I do so, but I'm not really understanding the difference since in either case I am only defining the abstract methods I want to expose as OperationContract elements. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Abstract class as ServiceContract From MSDN a.. An abstract class is permitted (but not required) to contain abstract members. As you can see " (but not required)" make the difference Arkady "DCBass" <DCBass@discussions.microsoft.com> wrote in message news:9BE6C1F4-2E93-47A5-80AB-F496D1AF88BA@microsoft.com... > Is there any way to use a pure abstract class rather than an interface as > a > ServiceContract? I get runtime errors when I do so, but I'm not really > understanding the difference since in either case I am only defining the > abstract methods I want to expose as OperationContract elements. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Abstract class as ServiceContract I realize what an abstract class is, but I don't understand why that actually makes a difference since in either case you are defining the interface (method signatures, etc) of that class. I'm talking about a "pure" abstract class where there is no implementation. This is a C++ concept but applies to C# as well (see http://en.wikibooks.org/wiki/Program...tract_Classes). If the purpose of a ServiceContract is to define the interface to the WCF service, why does it matter if it is specified in an abstract class or an interface? It seems that it should really only matter that the OperationContract attribute is only applied to abstract methods (whether they are defined in an interface or an abstract class). Is there any way to use an abstract class as a ServiceContract? If not, what is the reasoning behind limiting this attribute to interfaces? "Arkady Frenkel" wrote: > From MSDN > a.. An abstract class is permitted (but not required) to contain abstract > members. > > As you can see " (but not required)" make the difference > > Arkady > > "DCBass" <DCBass@discussions.microsoft.com> wrote in message > news:9BE6C1F4-2E93-47A5-80AB-F496D1AF88BA@microsoft.com... > > Is there any way to use a pure abstract class rather than an interface as > > a > > ServiceContract? I get runtime errors when I do so, but I'm not really > > understanding the difference since in either case I am only defining the > > abstract methods I want to expose as OperationContract elements. > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Abstract class as ServiceContract Pure abstruct class of C++ is interface in C#. Abstruct class in C# can in moment be changed to not so pure ( when you add the code ), that's why interface demanded Arkady "DCBass" <DCBass@discussions.microsoft.com> wrote in message news:C5901068-F2B5-45E1-A8C3-86EE2610BFEE@microsoft.com... >I realize what an abstract class is, but I don't understand why that >actually > makes a difference since in either case you are defining the interface > (method signatures, etc) of that class. I'm talking about a "pure" > abstract > class where there is no implementation. This is a C++ concept but applies > to > C# as well (see > http://en.wikibooks.org/wiki/Program...tract_Classes). > > If the purpose of a ServiceContract is to define the interface to the WCF > service, why does it matter if it is specified in an abstract class or an > interface? It seems that it should really only matter that the > OperationContract attribute is only applied to abstract methods (whether > they > are defined in an interface or an abstract class). > > Is there any way to use an abstract class as a ServiceContract? If not, > what is the reasoning behind limiting this attribute to interfaces? > > "Arkady Frenkel" wrote: > >> From MSDN >> a.. An abstract class is permitted (but not required) to contain abstract >> members. >> >> As you can see " (but not required)" make the difference >> >> Arkady >> >> "DCBass" <DCBass@discussions.microsoft.com> wrote in message >> news:9BE6C1F4-2E93-47A5-80AB-F496D1AF88BA@microsoft.com... >> > Is there any way to use a pure abstract class rather than an interface >> > as >> > a >> > ServiceContract? I get runtime errors when I do so, but I'm not really >> > understanding the difference since in either case I am only defining >> > the >> > abstract methods I want to expose as OperationContract elements. >> >> >> |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| When a class is both an inherited class of another, and alsoimplements an interface method | .NET General | |||
| win32_pingstatus class / dns class | PowerShell | |||
| Using a C# Class Library with VB6 | .NET General | |||