Posts Tagged “C#”
Here’s a super quick little powershell snippet to strip regions out of all C# files in a directory tree. Useful for legacy code where people hide long blocks in regions rather than encapsulate it into smaller methods/objects. Run this in your solution folder and support the movement against C# regions!
Every now and then I need to write tests that depend on the ID of a persistent object. IDs are usually private and read-only, assigned internally by your ORM, so I use a little fluent extension method to help set them via reflection. Tweak as desired to suit your naming conventions or base classes. Usage [...]


