My last adventure with Vue was fantastic, and I’ve also learned a lot of thing about npm, typescript and stuff like this.
I’ve so decided to create a Typescript Vue Plugin package for NPM, the Dew Translator that works in the same way of my DewLocalizationMiddleware for aspnet core.
Continue reading “Ehm, I am also on NPM?”
I’ve started to use Asp Net .core some month ago, and I like it. However, some approach used by default from the system like configuration options or localization for me are a little “old style”.
In this case, lets take the localization like example. Here how it works.
Continue reading “How to localize your webapp with Asp Net Core and DewLocalizationMiddleware”
Sometimes we need to call a function every time we get an instance of a controller (someone say constructor?).
However, the constructor has a bad limitation about the operations it can do. The HttpContext object isn’t initialized.
Let’s take a scenario. We had a cookie that needs be readed and initialized every time.
Continue reading “A base event for ASP .NET CORE controllers”
With asp .net core we have another concept of website.
There is not a scripting language with an interpreter, but we have a software that is listening on a port.
This mean that, the code in Program.cs and Startup.cs files will be executed just the fist time, at program launch. In fact, the Startup.cs file contains the Startup class, that built the middleware pipeline and it will be executed at any request.
So, a big problem that we can have with a config file is this: to any request, we need to read it from the disk, and this can be very expansive with an huge number of users.
A first way to fix this is to use AddJsonFile in the Program class when you build the configuration, and to use like explained here.
However, I use another way to do this, because I prefer access data via dot notation.
Lets see the alternative way to use a config file.
Continue reading “Create a config file in asp .net core”
When we talk about MVC on asp net, we know that the views are (in default approach) parts of our web page, because we have defined a layout that contains them. But sometimes we need/want to use a different layout, one of these scenario is for example when we have a different layout for logged/not logged users.
Let’s see an example, which use the simple AuthenticationCookie from NuGet package Microsoft.AspNetCore.Authentication.Cookies.
Continue reading “Change layout for authenticated users in asp net core”