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 |
What are value types and reference types?
public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
Which of the following operations can you not perform on an ado.net dataset?
What does the keyword virtual mean in the method definition?
What is different about switch statements in c#?
Explain the OOPS concept in C#?
What is the example of predicate?
What are the return types in c#?
What is the difference between hashtable and dictionary?
What r collections c sharp?
What is default access modifier for class in c#?
What is strong name assembly?