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 short in c#?

516


Explain when should you call the garbage collector in .net?

475


How can I create image pieces/sub image?

480


What is the difference between ref and out in c#?

461


What is cosole application?

562






What is typeof undefined?

501


What is querystring in c#?

482


What is deadly diamond problem?

540


Is c and c# the same?

492


What is the difference between string and string in c#?

463


What is a destructor in c#?

519


What is multithreading? What are the problems that comes with multithreading and how to manage them?

545


What is the base class of all classes in c#?

501


What is continue in c#?

504


What is difference between singleton and static class in c#?

472