Hi,
Can we implement the Abstract class on interface in c#, If
yes then provide the code implementation
Answer / 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 |
Is c# easier than c++?
What is private readonly in c#?
Can we inherit a private class in c#?
What is the use of parse in c#?
Can you declare the override method static while the original method is non-static?
Why is it not a good idea to use empty destructors?
1)what is timestamp in C# (anilringole@gmail.com)
How do you type a null character?
What is a nested type. Give an example?
What namespace is list in c#?
what is garbage collection?
Are c# strings null terminated?