I was doing some code analysis via code inspections from resharper and i got the next warning:
Only implementations of property 'propertyname' are used
This warning i have on my interface, if I google i found this page of jetbrains: http://confluence.jetbrains.com/display/ReSharper/Only+implementations+of+property+are+used
That didn't helped me at all because then i wouldn't have an interface anymore...
So I started testing how to get rid of that warning. On the folowing dummy interface and class:
public interface ITest
{
string Name { get; set; }
}
public class Test: ITest
{
public string Name { get; set; }
}
if i use:
var newTest = new Test();
newTest.Name= "newName";
Then the warning occurs. But when I use the next line, the warning will disappear.
ITest newTest = new Test();
newTest.Name = "newName";
I'm not an interface Ninja, so i was wondering, what is the difference between both manners..?
Thanks!