What is this?
Honestly, I’m a software engineer, a backend man… however, someone that can’t do frontends, grahpics, etc.
I love .net core, working with asp net core for websites and web api, but for UI until now I always used the classic approach: Razor pages + jquery.
One day I’ve met Vue.js. How you can imagine for a MVVM lover like me, with Vue has been love at first seen.
So I’ve tried to integrate it with aspnet core via Microsoft SPA Templates but Vue was no present in it. My first approach was to check the code on github JavscriptServices and create a VueDeveloperServer like for react, but after I’ve choose to use another approach to this scenario.
Continue reading “Vue js with aspnet core”
When I’ve started with Xamarin.Forms, my first problem was about app’s localization. All tutorials and also Xamarin documentation that I found regard only about PCL’s projects (that now are deprecated in favor of .net standard).
However, my scenario was better with shared project so I started the project in this way, saying to myself: “It’s time to face off the problem”.
I’ve thinked about a solution about app’s localization and I’ve developed the DewXamarinLocalization library, a .net standard library for xamarin forms.
So, let’s see how we can localize a Xamarin.Form shared project.
Continue reading “Localize your Xamarin Forms App with shared project.”
We’ve got a lot of projects in xamarin in these days: Forms, IOS, Android, etc.
My last work (in progress) is about a Xamarin Froms app and, in this app, I need to work hard with files.
So I’ve created a little library to manage files and local settings in .net standard. Works very well for UWP, Android, IOS for now.
You can find it on GitHub
Continue reading “Xamarin Forms files library”
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”
We already know that asp .net core works great with Microsoft technologies, but many times we need to work with other stuff.
Just think about the EF with SQL Server, the Identity or whatever things like these.
In my scenario, I needed to interface the website with a MySQL database. In this case I’ve been lucky, because I’ve found the a first implementation of a connector for MySQL (info here).
However my needs, I’ve wrote a new .net standard library based on MySQLConnector that use also ORM features in a very clearly way.
You can find it here with all docs for how to use.
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”
In many times people have asked me some question about strings in C#. The much quoted question is about: “What is the @ before the string?”
So, now I want try to give some pills about those strings in C#.
Just to be clear, I’m assuming that you already know a base of C# and strings operations (concats, escaping, etc.)
Continue reading “Pills of C#: strings”
One of my libraries on GitHub is the DewRestClient, a simple library that can help you to make REST request in .net. The library is writte in .net standard so you will be able to use it in a .net core, xamarin, uwp, etc. project.
Lets see how it works.
Continue reading “A REST Client in .net standard”
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”