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 encapsulation in csharp?
What basic steps are needed to display a simple report in crystal?
Can struct have constructor c#?
What is a console in c#?
What is thread life cycle in c#?
What is oledb in c#?
What is meant by generics in c#?
What is the reason behind the invention of c#?
What is a multi line comment?
What is ado c#?
What is the difference between virtual and override in c#?
Explain about Error handling and how this is done
What is orm in c#?
What is binding in c#?
Can we inherit abstract class in c#?