Using this example:
interface IFoo { string A { get; set; } } class Foo : IFoo { public string A { get; set; } public string B { get; set; } }
Then, using this code, I only get PropertyInfo for B
var fooProps = typeof(Foo).GetProperties(); var implementedProps = typeof(Foo).GetInterfaces().SelectMany(i => i.GetProperties()); var onlyInFoo = fooProps.Select(prop => prop.Name).Except(implementedProps.Select(prop => prop.Name)).ToArray(); var fooPropsFiltered = fooProps.Where(x => onlyInFoo.Contains(x.Name));
source share