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 collections in c#?
What is a console file?
what is diffrence between protected ,internal and protected internal?? whether protected field available in derived class which is outside the assembly. if not ..this is possible by which access modifiers??
difference between keyword internal and protected?
how can one use hcl and c sharp together?
What are delegates in C#?
What does private void mean in c#?
how to Create a datagridview control with check box column with 8rows in it, the maximum number of check boxes checked should be 3, when user checks the 4th corresponding message should be displayed and check box should be checked. User can uncheck the checked boxes Note: read-only property should not be used
What?s the .NET datatype that allows the retrieval of data by a unique key?
What are the delegates in c#?
Explain how do I get deterministic finalization in c#?
What is Fragmentation and its Types?
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)