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
What is short in c#?
Explain when should you call the garbage collector in .net?
How can I create image pieces/sub image?
What is the difference between ref and out in c#?
What is cosole application?
What is typeof undefined?
What is querystring in c#?
What is deadly diamond problem?
Is c and c# the same?
What is the difference between string and string in c#?
What is a destructor in c#?
What is multithreading? What are the problems that comes with multithreading and how to manage them?
What is the base class of all classes in c#?
What is continue in c#?
What is difference between singleton and static class in c#?