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 single dimensional array in c#?
What are expressions c#?
What is private readonly in c#?
How do I join one form to another in c#?
Explain manifest & metadata in c#.
What is streamreader/streamwriter class?
Why it's said that writing into .NET Application Configuration Files is a Bad Idea?
Which constructor is called first in c#?
Which of the following operations can you not perform on an ado.net dataset?
What is an object pool in .net?
Why attributes are used in c#?
Which framework is best for desktop application?
How do you pronounce c#?
The int maps to which C# keyword in .NET type?
How assembly versioning in .NET prevent DLL Hell problem?