{"id":3437,"date":"2015-10-15T21:02:11","date_gmt":"2015-10-15T21:02:11","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=3437"},"modified":"2015-10-15T21:02:11","modified_gmt":"2015-10-15T21:02:11","slug":"how-many-methods-in-my-classes","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/how-many-methods-in-my-classes\/","title":{"rendered":"How many methods in my classes ?"},"content":{"rendered":"<p>I won&#8217;t waste time on this post explaining why I had to do this, but I had to find the number of methods on a whole bunch of classes. <\/p>\n<p>NDepend to the rescue. Using the CQLinq language I wrote<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nApplication.Methods.Where(m =&gt; \r\nm.ParentType.Name == &quot;ClassName1&quot; ||\r\nm.ParentType.Name == &quot;ClassName2&quot;).\r\nCount(m =&gt; !m.IsGeneratedByCompiler)\r\n<\/pre>\n<p>Now I&#8217;ll admit the list of classes was coded directly into the query, which is obviously no good for reusing the query, but this mean&#8217;t it was quick and easy to get the code up and running in no time at all &#8211; and thus get my answer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I won&#8217;t waste time on this post explaining why I had to do this, but I had to find the number of methods on a whole bunch of classes. NDepend to the rescue. Using the CQLinq language I wrote Application.Methods.Where(m =&gt; m.ParentType.Name == &quot;ClassName1&quot; || m.ParentType.Name == &quot;ClassName2&quot;). Count(m =&gt; !m.IsGeneratedByCompiler) Now I&#8217;ll admit the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[100],"tags":[],"class_list":["post-3437","post","type-post","status-publish","format-standard","hentry","category-ndepend"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=3437"}],"version-history":[{"count":3,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3437\/revisions"}],"predecessor-version":[{"id":3465,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3437\/revisions\/3465"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=3437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=3437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=3437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}