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 |
List down the fundamental oop concepts?
How does c# achieve polymorphism?
What's the difference between abstraction and encapsulation?
update data in an xml file which resides in solution itself, using silverlight 4.0
What is a decimal c#?
Why do we need collections in c#?
Define thread?
How cache is implemented in web application for DB queries?
What is the difference between static class and sealed class in c#?
What is event and delegates in c#?
What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?
Can struct be static in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)