Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi,
Can we implement the Abstract class on interface in c#, If
yes then provide the code implementation

Answer Posted / rakesh

public interface IService<T>
{
int Add(T entity);
void Update(T entity);
}

public abstract class ServiceBase<T> : IService<T>
{
public int Add(T entity) { ... }
public void Update(T entity) { ... }
}

public interface ICarService : IService<Car>
{
}

public class SomeBaseClass : ServiceBase<Car>, ICarService
{
public int Add(Car entity);
public void Update(Car entity);
}

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is single dimensional array in c#?

901


What are expressions c#?

863


What is private readonly in c#?

907


How do I join one form to another in c#?

873


Explain manifest & metadata in c#.

940


What is streamreader/streamwriter class?

896


Why it's said that writing into .NET Application Configuration Files is a Bad Idea?

927


Which constructor is called first in c#?

892


Which of the following operations can you not perform on an ado.net dataset?

932


What is an object pool in .net?

1009


Why attributes are used in c#?

840


Which framework is best for desktop application?

945


How do you pronounce c#?

852


The int maps to which C# keyword in .NET type?

990


How assembly versioning in .NET prevent DLL Hell problem?

907