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.

1 min read

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
2 min read

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.

1 min read

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:
~1 min read