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 expression tree with example?

890


Explain what is copy constructor?

1017


if a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

1050


Why are mutable structs evil?

968


How long does it take to learn c# programming?

901


What is a dimensional array?

836


What is the difference between static and private constructor in c#?

1001


Is string a class in c#?

834


When should I use static in C#?

971


What is difference between first and firstordefault?

903


Explain the three test cases in unit testing?

998


What is a virtual property. Give an example?

934


what are the contents of an assembly ?

984


Explain the functionalities of satellite assembly?

948


For methods inside the interface why can’t you specify the accessibility modifier?

948