Object oriented design is all about encapsulation. A class provides methods to manipulate its data and only allows manipulation that keeps the objects’ state correct. That works fine in theory, but in real life objects need to be loaded/materialized from a database and this usually means that property setters must be public. But not with… Continue reading Entity Framework Core and Private Properties
Category: C#
A form-entry
Tag Helper
Writing line of business applications usually means creating a lot of forms for data entry. Writing the HTML for them over and over again is tedious and also means copy-pasting the layout structure into every single form. Copy-pasting works fine as long as we one is happy with the design, but when it needs to… Continue reading A form-entry
Tag Helper
Renaming Kentor.AuthServices Nuget packages to Sustainsys.Saml2
Last year I left Kentor for new adventures as an independent consultant. I got the Kentor.AuthServices project with me, but of course need to rename it as it is not associated with Kentor any more. So how does one rename a library and nuget packges with 100k+ downloads and users all over the world? Simply… Continue reading Renaming Kentor.AuthServices Nuget packages to Sustainsys.Saml2
Expression Bodied vs. Auto Read-Only Properties
C#6 brought some nice short-hand ways of handling properties. I really like them, because they take away much boilerplate code. But as with all new tools, it’s easy to use them wrongly until they are familiar. These are two attempts to declare a readonly property that preserves the time stamp of when the object was… Continue reading Expression Bodied vs. Auto Read-Only Properties
When Code Coverage Betrayed Me
I’m a fan of code coverage as a way to ensure that there are covering tests. One area that I tend to rely heavily on Code Coverage for is to catch any tests that are no longer working correctly due to changes in the production code. That often works out well, but today I got… Continue reading When Code Coverage Betrayed Me