Solving tech problems

ASP.NET Core 3.1 Identity tables in MySQL

Uncategorized

To have identity tables in MySQL install Pomelo package, set the connection string and DBContext in Startup.cs like this: services.AddDbContext(options => options.UseMySql(Configuration.GetConnectionString(“MySqlConnection”)); Open NuGet > Package Manager ConsoleRun: EntityFrameworkCore\Update-Database -VerboseRun: update-database

XPATH cheatsheet

Uncategorized

This post was inspired by great this find, which I managed to search while working on one project. It happens few times in the past that some interested content was not available any more and in order to save this great cheatsheet I am copying it from LeCoupa

Entity Framework in .NET and MySQL tinymce(1) problem

Programming

You know at tinymce(1) field in MySQL database will be converted to boolean type in C#. Sometimes you don’t want this because you just want to read the integer value from MySQL in this field (it can be any from 0-255 if unsigned or -127-127 if signed) – one byte. In order to do so you need to do two things: Add TreatTinyAsBoolean=false to your connection string Edit the database edmx file and in SSDL content section change bool to tinyint, and in CSDL content section change Boolean into SByte….read more

Microsoft .NET to run on Linux and Mac OS X

Learning, Products and Services, Programming, Technologies

Microsoft .NET will finally run fully on Linux and Mac OS X platform and this is a great news. Visual Studio is maybe the best tool for developers and Microsoft decided to open sourcing the full server-side .NET Core stack, from ASP.NET 5 down to Core Runtime and Framework. Microsoft is also giving for free Visual Studio Community 2013 full featured edition of Visual Studio, available today. You can watch more about this here. Open source links ASP.NET – https://github.com/aspnet/home .NET Compiler – https://roslyn.codeplex.com/ .NET Core – https://github.com/dotnet/corefx .NET –…read more

How to escape parenthesis/brackets ‘{‘, ‘}’ in string.Format?

Programming

Usually you have something like this: string.Format(“Output: {0}”, “A”); This will result as: Output: A What you should do if you want to make an output like this? Output: {A} You need to escape parenthesis/brackets like this: You use {{ to output { You use }} to output } So, you final C# command should look like this: string.Format(“Output: {{{0}}}”, “A”);