0 Hi Shashank
Yes it's possible;
check the bellow code;
interface MyDemoInterface
{
void getdata(MyDemoInterface ie);
}
class DemoInterface:MyDemoInterface
{
int no { get; set; }
public string name { get; set; }
public void GetData(DemoInterface dd)
{
}
public void getdata(MyDemoInterface ie)
{
throw new NotImplementedException();
}
}
Hope this helpfull.
0 In the interface, you can specify the property:
public interface IPolicy
{
string Name { get; set; }
}
You need to implement it in implementation class:
public class MyPolicy : IPolicy
{
public string Name { get; set; }
}
0 Hi Shashank,
Interfaces in C# don't contain fields
https://stackoverflow.com/questions/2115114/why-cant-c-sharp-interfaces-contain-fields