Announcements CodeCop

Announcing CodeCop 1.1.0 with Fluent API

I’m very proud to announce CodeCop 1.1.0, a very special release. Why is it special? Well as you know CodeCop works with JSON in order to intercept methods in .NET, but we’ve been asked a lot from the Community since day one why there wasn’t a Fluent API in the first place?

So this version is special because we heard you! We’ve integrated a full-blown Fluent API onto the product, so let me dedicate this release to all the people that are helping this product grow and are interacting with us on a daily basis. We know you were “dying” for something like this. 🙂

How does it work? Is it simple to use? It’s so simple to intercept a method you won’t believe your eyes. Check this example that was extracted from our wiki:

 class Program
    {
        static void Main(string[] args)
        {
            // Tell the runtime not to use JSON but instead use the Fluent API
            Cop.AsFluent();

            // Grab the method to intercept
            var method = typeof(Program).GetMethod("Method1");

            // Do your interception magic
            method
                .DecorateBefore((context) => Console.WriteLine("Before"))
                .DecorateAfter((context) => Console.WriteLine("After"))
                .Override((context) =>
            {
               Console.WriteLine("{0} was Overrided!", context.InterceptedMethod.Name);
               return null;
            })
                 .OnError((context) =>
            {
                Console.WriteLine("Exception occurred {0}", context.Exception.Message);
            });

            // Bootstrap CodeCop
            Cop.Intercept();

            // Call the intercepted method as you would normally would
            Method1();

        }

        public static void Method1()
        {
            Console.WriteLine("Method1");
        }
    }

And the result? There you go, the same exact result you would obtain if you would have used the JSON API.

fluent

But that’s not all folks. Because we want this to be a really outstanding release we are also unblocking all the functional features that were restricted to the Developer and Ultimate versions of the product for the Free version!

Yeah, you read it right! 😉 But before you fall out of your chair, don’t forget to subscribe to the 5-Day Free Crash Course To Method Interception that is available on our homepage. All subscribers will be getting a 10% discount on all product licenses, so don’t miss this time-bounded opportunity as we’re closing the course really soon.

Now, head to Visual Studio grab your keyboard and start kickin some methods ass with CodeCop. Tell us what you are doing with it, we’d love to ear from you.

See ya next time!

Free Email Updates
Get the latest content first.
100% Privacy. No spam.

Liked it? Please Share.

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *