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
Can abstract class instantiated c#?
What is the purpose of static?
What does mean c#?
Are structs value types or reference types?
So what makes your code really object-oriented #?
Is datetime nullable c#?
How jit (just in time) works?
How do you sort an array in c#?
What is the difference between Decorator and Adapter pattern?
Is stringbuilder faster than string concatenation c#?
How Is The Dll Hell Problem Solved In .net?
How can I process command-line arguments?
What is the difference between abstraction and encapsulation in c#?
Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?
What are the delegates in c#?