ServiceStack 4 HTTP Utilities: Functional Contract Testing ServiceStack 4 comes with some really great new tools for accessing an HTTP resource using a fluent syntax. They make a great addition – sometimes the JsonServiceClient (often just called the C# client) is a little too smart! For instance, let’s say you’ve published a specification saying how … Continue reading
Tag Archives: c#
ASP.NET/MVC Web Security Basics: CSRF
Cross Site Request Forgery, which is sometimes known by the acronyms “XSRF” or “CSRF”, is a category of attacks against a web site which can be very effective – when applications are vulnerable, it’s possible to create real problems. A common example of CSRF in an online banking application can cause a bank account holder … Continue reading
When to use exceptions, vs. when to code defensively?
This blog post is a repost of an answer I wrote at programmers.stackexchange.com. To answer the question of which is considered better practice, between exceptions and coding defensively: In .NET, its common practice to avoid the overuse of Exceptions. One argument is performance: in .NET, throwing an exception is computationally expensive. Another reason to avoid … Continue reading