With EntityFramework’s support for enums, there is no longer any need to include lookup tables in the model. But I do want to have them in the database for integrity, even with code first. I’ve been thinking for some time about to handle enums with code first. The idea behind code first is to be… Continue reading Enums and Lookup Tables with EF Code First
Category: C#
Improving Unit Testing with FluentAssertions
FluentAssertions is an alternative assertion library for unit tests, to use instead of the methods in Assert class that Microsoft provides. It has much better support for exceptions and some other stuff that improves readability and makes it easier to produce tests. The coding of Kentor.AuthServices was a perfect opportunity for me to do some… Continue reading Improving Unit Testing with FluentAssertions
An Open Source ASP.NET SAML2 Service Provider
I’m happy to announce an open source ASP.NET SAML2 Service Provider. SAML2 is a common standard for single sign on in enterprise environments. A Service Provider in SAML2 is a web site that allows log on through SAML2 Identity Provider (IdP). Implementing a Service Provider requires issuing authentication requests (AuthnRequest) and handling the returned response.… Continue reading An Open Source ASP.NET SAML2 Service Provider
Exception Safety and IDisposable Factories
C# is mostly relieved from the stress of exception safety, thanks to garbage collections. But in some cases it must be handled. A common case is factories creating more than one IDisposable object. Coming from a C++ background, the notion of exception safety is natural to me. For a C++ developer exception safety is as… Continue reading Exception Safety and IDisposable Factories
Examining the Generated cs File for a cshtml View
Cshtml files are compiled by Razor into C# files. To track down some errors (or just to understand Razor) it might be useful to examine the C# code generated. For testing I created a small Razor view in an MVC4 project. @{ string someString = "somestring"; var someBool = false; //- } <h1>Header</h1> … Continue reading Examining the Generated cs File for a cshtml View