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 |
Can I define a type that is an alias of another type (like typedef in c++)?
What is executereader in c#?
What is difference between method overriding and method overloading?
What is fcl in c#?
how to implement a web service in .net
Is array value type in c#?
What is iqueryable in linq?
in the nunit test framework, which attribute must adorn a test class in order for it to be picked up by the nunit gui?
what is an internal specifier? what happens internally when I use access specifier Internal ?
how can i return string by vilating duplicates(inpyt like asdfsda but output should be 2a2d2sf and 2a,2d,2s,f)
Explain the difference between “constant” and “read-only” variables used in c#?
What is Satellite Assemblies ?
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)