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 does int parse do in c#?

983


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

1016


What is dynamic object in c#?

968


What is writeline in c#?

911


What is difference between singleordefault and firstordefault?

960


How do you encapsulate in c#?

975


Can arraylist hold primitive types?

1098


How to sort an int array in c#?

1003


What are class fields?

1006


Can we inherit class that contains only one private constructor?

1010


What are the 4 pillars of any object oriented programming language?

927


How do I run a cshtml file?

958


What is Event - Delegate?

1125


Why cannot you specify the accessibility modifier for methods inside the interface?

966


Can we declare private class in c#?

958