I have:
public interface ITest
{
string test { get; set; }
}
And
[DataContract]
public class TestGeneric : ITest
{
[DataMember]
public string test;
}
But i keep getting the error: 'TestGeneric' does not implement interface member 'ITest.Test'
on TestGeneric
in the public class TestGeneric : ITest
line of code. Would someone be able to explain why this is?
You have created a field, as you omitted the { get; set; }
accessors that make a member a property.
The implementation must match the interface exactly, so add those accessors:
public class TestGeneric : ITest
{
public string Test { get; set; }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With