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 encapsulation in csharp?

925


What basic steps are needed to display a simple report in crystal?

908


Can struct have constructor c#?

858


What is a console in c#?

806


What is thread life cycle in c#?

913


What is oledb in c#?

883


What is meant by generics in c#?

865


What is the reason behind the invention of c#?

1041


What is a multi line comment?

907


What is ado c#?

891


What is the difference between virtual and override in c#?

971


Explain about Error handling and how this is done

895


What is orm in c#?

893


What is binding in c#?

849


Can we inherit abstract class in c#?

868