.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Can WCF inherit a standard class interface?????

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :WCF

I have a standard Object Interface (read: no data contract decorations)  that is inherited by a number of classes. I want to enable this inteface for a new WCF service.

For example:

public interface iVendor


View Complete Post

More Related Resource Links

LINQ to SQL compiler error CS1519: Invalid token 'void' in class, struct, or interface member decl

I get the following compiler errors when creating my first LINQ to SQL class (I just dragged a table "ProfileExtended" onto the designer and hit build):DataClasses.designer.cs(31,11): error CS1519: Invalid token 'void' in class, struct, or interface member declaration these are the offending lines of autogenerated code:#region Extensibility Method Definitions  partial void OnCreated();  partial void InsertProfileExtended(ProfileExtended instance);  partial void UpdateProfileExtended(ProfileExtended instance);  partial void DeleteProfileExtended(ProfileExtended instance);  #endregion

when abstract class and when interface

hi...need a practical scenario where interface can be used and where abstract class and also the need for constructors and destructors practically?? theoritically i know the differences ..but during coming to the implementation how to decide??...like why do u declare a class as abstract... thanks in advance 

Interface object Versus Class Object


Asslam o Alaikum

namespace Interface
    interface IMyInterface
        void Start();    
        void Stop();

    class Program : IMyInterface
        void IMyInterface.Start()
            Console.WriteLine("\n Void Start Method Implement");
        void IMyInterface.Stop()
            Console.WriteLine("\n Void Stop Method Implement");
        static void Main(string[] args)
            IMyInterface iMyInterface = new Program();

1. IMyInterface iMyInterface = new IMyInterface(); // if i create the object of interface i get Error
2. Program iMyInterface = new Program(); // if i create the object of program i can't get the property of Interfaces i.e. Start(); stop();
3. IMyInterface iMyInterface = new Program(); // This will work fine

i want know the difference about 3 points can any body claer it ..


Regarding Creating Custom Field type Class Inheriting from IFieldEditor Interface and UserControl C


How to enable the hidden labels On Create Column Page after selecting our Custom Field type before just ckicking OK so that all those labels appear.

Web Service to inherit from a Custom Base Class that inherits System.Web.Services.WebMethod instead


Hi All,

Recently, I tried to get my Web Service class to inherit from a custom base class that inherits from System.Web.Services.WebMethod instead of the System.Web.Services.WebMethod directly.

However, I've been getting Error 500.

Public Class Service1
    Inherits BaseClass
    <System.Web.Services.WebMethod()> _
    Public Function GetSessionID() As String
        GetSessionID = Me.Session.SessionID
    End Function
End Class


public class BaseClass
    Inherits System.Web.Services.WebService

    public property Property1 as string
    public property Property2 as string

End Class


Please kindly assist.

Thank you in advance.

Warmest Regards,


When to use Interface instead of class, in VS 2008



Why do we use Interface instead of class in VS 2008?

What between about Interface and class in VS 2008,high performance?

How to set view properties from another class/interface


There is a SearchPage which has a properties ErrorMessage, SuccessMessage etc. This is basically a MVP pattern so for each page(view) there is IView that contains definitions for all the properties

I am using decoratoe pattern to set these peoperties dependingon the message type. There is another Interface IBaseMessage which has a method DisplayMessage() and a class BaseMessage which implements the interface. This class has a definition of the view

Interface IbaseMessage






public Iview _view{get; set;}



_view.Warning ="<message>"



Here, I am not able to set the message to the view properties. I am getting the error as "Object reference not set to an instance of the object"

Somehow the access is not going till theview from the class BaseMessage. I may be missing something. Please help

Appreciate your help!


force use of interface instead of directly instentiating implemented class

    interface ITest
        int Add();
    class Test:ITest
        public int Add()
            throw new NotImplementedException();

    public class Program

        static void Main(string[] args)
            // OK
            ITest t = new Test();
            // disallow below 
            Test t1 = new Test();
           // Since both works, how to stop others from directly instentiating implemented class


Adding IServiceClient interface to generated proxy service client class

would it be possible to add a service client interface to a generated service client class in a generated service proxy in order to achieve easier testability?
Here's an example of what I am asking the way I do it manually http://blog.vuscode.com/malovicn/archive/2009/11/01/design-for-testability-wcf-proxies.aspx

This would not break backward compatibility (safe to be added)

Is this question more for Connect? :)


what is the difference between abstract class and interface

hi,recently i went for an interview they ask me what is abstract class ,interface and its difference
I said abstract class contain abstact method ,abstract method is a method with no body.Abstract class cannot be instantiated.Abstract class is a base class it required derived class for the implementation of method.
Interface is a syntactical contract that all derived class should follow 
it define properties ,method,events which are known as member of interface.
Then They asked me what is the difference between them. I said 
abstract class interface 
1.abstact class can implement method 1.interface cant
2.abstact class can contain constructor, 2.interface cant
3.abstract class cannot support multiple 3.interface support
Then they said some different answer I said dont no.
Then they ask me when i should make abstract class for an project and when 
i should make interface.
I said if suppose there is two class which must be having method with different logic then we sholud make abstract class. 
and if suppose we have two class having method .with different logic then we can make interface .
Am i correct with my explainatio

how to inherit a dynamic class from existing base class in C#?

i have created   dynamic class using CodeDom,but now i,want to inherit the dynamic class from my base class...becoz i have created methods in my base class n now i want to inherits these methods from that base clss in  my new dynamic class....plzzzzzzzzzzzz someone help me i have search alottt but didnt find any piece of code...i also tried reflection.emit but i face same problem in Reflection.emit...so plz help me..

Class Diagrams

Class diagrams show the static structure of the systems. Classes define the properties of the objects which belong to them. These include:

Attributes - (second container) the data properties of the classes including type, default value and constraints.

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Static Class for Beginners

In general, the members of a class can be accessed by instance of that class when they are in public, but there comes a situation to access or call members of a class without an instance and this can be achieved by declaring them as static

Microsoft SharePoint Online Standard Developer Guide

Developers Guide for SharePoint Online (Standard Offer). Microsoft® Office SharePoint® Online is a collection of Web-based tools and technologies built on Microsoft Office SharePoint Server 2007 that help you store, share, and manage digital information within your company. This white paper describes the customization (or extensibility) capabilities that are supported with the Standard offering of SharePoint Online

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

MessageQueue Class

This sample demonstrates two way communications using message queuing between a device application and a desktop application. One application sends book order messages to a message queue and another application receives these book orders from the message queue and responds to the device queue that the orders have been processed.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend