c# 4.0 get class properties with (specified attribute and attribute.data) <p>I would like to get what properties of my class have an exact attribute with a concrete string. I have this implementation (Attribute and Class):</p> <pre><code>[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] public class IsDbMandatory : System.Attribute { public readonly string tableField; public IsDbMandatory (string tableField) { this.tableField= TableField; } } public Class MyClass { [IsDbMandatory("ID")] public int MyID { get; set; } } </code></pre> <p>Then I get the property with the concrete attribute in this way:</p> <pre><code>public class MyService { public bool MyMethod(Type theType, string myAttributeValue) { PropertyInfo props = theType.GetProperties(). Where(prop =&gt; Attribute.IsDefined(prop, typeof(IsDbMandatory))); } } </code></pre> <p>But I need only the properties with concrete attribute <code>isDbMandatory</code> AND concrete string <code>myAttributeValue</code> inside.</p> <p>How can I do it ?</p>