Entity Framework Core - preview model
In this article, I show you VisualStudio extension EFCorePowerTools written by Erik Ejlskov Jensen which lets you see how Entity Framework Core interpreting your model. This extension is very helpful to avoid problems when EF Core interprets the model in a different way than you anticipated. EF Core has some conventions that you should follow to receive the desired database schema. With this extension, you don’t have to apply the migration to the database to see if you didn’t make any mistakes in your model. You can preview the model in the graph or you can generate SQL scripts to see what will be generated in your database.
WPF - create custom button with image (ImageButton)
In this blog post, I will show you how you can create a custom control ImageButton. In this control, we will use Grid control to locate our image and the content of the button will be always in the center of it. You don’t have to specify the button content - in this case it will be an image button only. ImageButton inherits from Button so you can access all button’s properties. Additionally, you can set the following properties:
- ImageSource
- ImageLocation (Left, Top, Right, Bottom, Center)
- ImageWidth
- ImageHeight
ASP.NET Core Tag Helpers - Cache Busting
Have you ever had a problem with stale JavaScript or CSS files in browsers using by your customers? How many times did you explain to your customers that they should clear the cache? And how many times did you hear the following words “How do I do that?”? If you don’t want to have these problems in the future please read this blog post.
How to enable Browser Link in ASP.NET Core 3.1
This guide will step you through the process of enabling Browser Link in ASP.NET Core project.
Secure static files in ASP.NET Core
The Static File Middleware doesn’t provide authorization, all files served by this middleware are publicly accessible. Static files are stored in the following directories:
- Web root directory -
{content root}/wwwroot
- it’s the default directory - you can also serve files outside the Web root directory by specifying it in the
UseStaticFiles
method as below:
ASP.NET Core - how to bind enum to HTML select tag
In this post, you will see how to bind enum to HTML select tag. Let’s say that you have class Person
and one of its properties is enum (in our case it’s enum Gender
).
SQL query for records that contain a percent character
Let’s say that you have a table (shown below) and you want to select rows where column Name
contains a percentage sign. So in this case query should return rows with ids: 3, 5 and 6.
NuGet - error NU1108: cycle detected
Lately, when I wanted to create a sample program with an IdentityServer4 I bumped into a problem with NuGet.
DevExpress GridControl - change default text by using Localizer class
If you want to translate default text e.g. “Click here to add a new row” in the GridControl
you can use a Localizer class. Each DevExpress component has a specific Localizer class but not all string can be translated via that class.
.NET Core 3 preview - not working in VS2019 main release
If you have installed VS2019 main release (version 16.0.*) you cannot create a new project with target platform .NET Core 3 by default. To make it possible you have two options: