We are using the Repository design pattern in our application and using CodeSmith to auto generate the code. The code it generates "fits" perfectly into our overall design philosophy except for the code that selects data from the DB. We
are using custom classes to handle selects. I wont bore anyone by going into the particulars.
I've already come across one of my developers NOT doing what he was told, aka. ONLY using the custom select methods. Instead he has used some of the auto generated GetAll() and GetByPrimaryKey() methods. Therefore, I'm trying to add some custom style
cop rules to flag these cases and display a warning. So here is the basic pattern I would be looking for:
repo.DB.dbo.DBTableName.GetAll() or repo.DB.dbo.DBTableName.GetByPrimaryKey() and these would both appear (I'm guessing) as statements within Elements? but obviously there are all kinds of ways to look for certain ElementTypes or Expression tokens
or Fields, etc. etc. and I'm a little confused what I want to do and look for.
Any help would be appreciated, including small sample code.