With the code below you can copy and set specific permissions to a directory within Net app.
(read more...)With the code below you can copy and set specific permissions to a directory within Net app.
(read more...)An application that was developed by me as a service with Net Core 8 didn’t want to start working as a Windows service. The application was created in Visual studio 2022 with a “Worker service” template. If you just start the app, it works. But I had problems to start it as a Windows Service.
(read more...)SmartFormat is a is a lightweight text templating library to replace string.Format. Unlike common String.Format, with SmartFormat you can read templates from text files or another source. Here I will share the way, how I tried to write the DateTime in the format 'dd/MM/yyyy HH:mm:ss'. It was not so obvious.
(read more...)AutoMapper is a simple little library which allows you to make less code for transforming objects of one class to another. It's a must-have library for any complex project. There is a short scenario in 5 steps how to add and use AutoMapper in a new Net Core project with REST API.
(read more...)Once again I have to make Export of to Excel. And this time there are requirements to the template – colors, formatting and others. Not so long ago I implemented the export to Excel with XLSX package for React, and it was rendered at client. This solution is good but has many constraints. So, I started to look for another solution.
(read more...)When you execute your Web Api and at Swagger Page you can see Swagger error ‘Failed to load API definition’, you can’t really determine, where the error is. It is in one of the controllers. But do you want to check all of them?
(read more...)In one Web Api Net Core solition I used Microsoft.AspNetCore.Identity.EntityFrameworkCore for Authentication. It’s really comfortable to work with this package because you a free from the implementation of all the methods and don’t spare much time. It also returns the text of errors, for example, that password is to short or special character is required. For me everything was ok, but the customer wanted to see the text in German.
(read more...)There’s a nice online tool for rendering the test data. It’s at the website https://www.mockaroo.com/. I often use it to render fake SQL data. But now I am working on a Net application with EF Core. And obviously, I need test data for webservices and interfaces. Below is the way to quickly insert the test data in the Net solution.
(read more...)It's an extremely nice article about how to implement the Role-based Authorization in Net Core Web API. I won't copy it here because it's written to good. Maybe I will publish to Git a template app later, but now just save for future.
(read more...)In apps with different Roles and permissions you may need to get information about AD Groups. Here are some snippets which can help you with this part of the task.
(read more...)