I post .NET / C# and Visual Studio content on LinkedIn and Twitter almost daily. Please consider following me. LinkedIn … Continue reading Please follow me on Twitter and LinkedIn for more .NET content
By default Entity Framework converts strings to nvarchar(MAX) in SQL Server which isn’t ideal. We can configure this mapping in … Continue reading Setting default global configuration for .NET types in Entity Framework
By default Entity Framework will convert string properties to nvarchar(MAX) or nvarchar(123) where 123 is the length we have set … Continue reading How to make strings non-Unicode in Entity Framework Code First
The const and readonly keywords in C# are used to declare variables that cannot be changed after they are initialized. … Continue reading Difference between const and readonly in C#
Normally if we want to include certain navigation properties we have to explicitly do it on a query by query … Continue reading How to auto include navigations in Entity Framework
It’s simple enough to get started with the Entity Framework Database First approach using the command line, but it’s even … Continue reading Entity Framework DB First quick start using EF Core Power Tools
When we turn on logging in Entity Framework, by default it won’t output sensitive information such as query parameter values … Continue reading Include sensitive data in Entity Framework logging by setting EnableSensitiveDataLogging
The FromSqlInterpolated method in Entity Framework Core is used to execute a raw SQL query that contains interpolated parameters. Interpolated … Continue reading Entity Framework FromSqlInterpolated examples
From Visual Studio 2022 17.6 we’ll be able to see real world examples of common .NET APIs on GitHub direct … Continue reading GitHub examples of .NET method usages visible in Visual Studio from 17.6+
I posted my previous simple string concatenation benchmark results where I was concatenating my name with spacer on Reddit recently. … Continue reading Simple string concatenation using String.Create and other performance sensitive approaches in .NET 8
With NuGet 6.7 which is available in Visual Studio 2022 17.8 Preview 1 (August 8th 2023) we can now see … Continue reading NuGet 6.7 shows which packages are vulnerable in Visual Studio
Visual Studio 2022 17.8 Preview 1 was released last week (8th August 2023) and a really cool new feature it … Continue reading New summary diff view to only see changes now available in Visual Studio
Do we rely too much on third party libraries from NuGet? Are we exposing our clients to risks here by … Continue reading Do .NET developers rely too much on third party libraries from NuGet?
I took this Twitter poll recently to gauge how many devs were thinking of moving away from Moq after the … Continue reading Poll Results : Are many .NET devs moving away from Moq after #moqgate?
What are Cognitive Biases? A cognitive bias is a systematic thinking error that affects our decisions and judgments. They’re our … Continue reading 7 Cognitive biases influencing our software development decisions
Dear .NET friends, how do you like to create your mocks? 🤔 …With a framework like Moq or manually? I … Continue reading Do you use a mocking framework or manually create your mocks?
Warnings are too easy to ignore. Consider treating all warnings as errors by setting the TreatWarningsAsErrors property to true in … Continue reading How to treat all warnings as compile errors in .NET
To set properties for every project in a directory in a centralized location create a Directory.Build.props file in your solution … Continue reading Share settings across multiple projects using a Directory.Build.props file
In C# 9 Target Typed New Expressions were introduced. They allow us to infer type on the right, whereas var … Continue reading Use Target Typed New Expressions to infer type on the right in C# 9 +
I was wondering recently which .NET mocking library is most popular. I suspected Moq but ran a poll to find … Continue reading Poll Results : What .NET mocking library do you use?
Do you know about the PARAMS keyword in C# ? The params keyword allows us to create methods that accept … Continue reading Use params keyword in C# to accept a variable number of arguments of the same type
I love parameterized tests. Instead of many different test methods with different inputs set in the method body we have … Continue reading How to create Parameterized Tests with xUnit
Which .NET mocking library syntax do you prefer from the below test examples? Moq?NSubstitute?FakeItEasy? … and which library do you … Continue reading Moq, NSubstitute and FakeItEasy mocking library syntax comparison
It’s always a divisive topic but in your experience, does Test-Driven Development (TDD) improve code quality more than writing tests … Continue reading Poll Results : Does TDD improve code quality over writing tests after code?
When using Entity Framework, storing mapping configurations inline directly in OnModelCreating can make our DbContext class cumbersome and less readable … Continue reading Using IEntityTypeConfiguration config classes to configure Entity Framework entity mappings