
Image from Pexels
Tagged articles - .NET Core
Found 63 articles tagged with .NET Core
16
Jun
2021
C# scripting with .NET Core global tool
.NET229 titlesUsing .NET Core global tool to run C# script files
0
I assume since you are reading this article you are involved in development of applications using C# and .NET platform. Microsoft .NET and C# have been around for quite a while but there is not much talk on haw you can use C# for writing code apart from creating your projects in your IDE of choice and compiling them to executables.
This is typical approach for writing robust applications and that is fine, but from time to time, this whole ceremony of creating a project, adding packages and libraries just to run for example a simple scheduled task that cleans up old logs from IIS seems like and overkill...read more
25
May
2021
Using interceptors with dependency injection in Entity Framework Core
.NET229 titlesEF Core interceptors via dependency injection in ASP.NET 5
0
I while ago I wrote an article on how to Access multiple databases from the same DbContext in EF Core which relies on interceptors to mutate the SQL query diring execution. This code works just fine and it updates the command prior to it's execution, but it lacks in option to inject registered services to it's constructor as i used new keyword to initialize class instances.
Adding interceptor without dependency injection
...read more
01
Feb
2021
Setting Azure DevOps pipeline variable from PowerShell script
PowerShell24 titlesOutput value from PowerShell script to Azure DevOps builds and releases
0
When using Azure DevOps Pipelines or Releases, it is pretty easy to move informations from the pipeline/release into the target artifact package or folder on the target environment. What can be tricky if you need to dictate your pipeline/release based on the value from your code base or maybe the environment to which you are deploying to.
As a simple example I set the version attribute in in my .csproj file which I will use to tell UseDotNet task in my build pipeline which SDK to use to perform .NET Core project build.
...read more
17
Nov
2020
Accessing multiple databases from the same DbContext in EF Core
.NET229 titlesMultiple database access from the same DbContext in Entity Framework Core 5
0
It is not uncommon to have a requirement to access tables or views in different databases in the same query. In order to be able to do your joins on tables or views in different databases you need to do it in the same connection instance which is bound to DbContext, therefore this access as to be accomplished from the same DbContext instance...read more
11
Sep
2020
Building and using advanced .NET Core CLI global tools
.NET229 titlesHandling commands, arguments and options in .NET CLI global tool application
0
Once .NET Core 2.1 SDK introduced support for global tools I wrote a brief article on how to create a simple global CLI tool in .NET Core Building advanced .NET Core Global Tool using CommandLineUtils package.
While this is fair enough informations to kick-start you project and create a simple global tool to use from the command line, I found out there is more to it in order to have the tool built, published, distributed and used especially when you are dealing with real-life applications that need to have a CLI as a part of the solution.
...read more
21
Jun
2020
Dealing with default API versions in Swagger UI
.NET229 titlesFixing additional routes in Swagger API when using default versions
0
Having your REST API versioned is important for evolving of the service over time. Especially if your service is exposed t multiple 3rd party clients...read more
11
May
2020
Setting up code coverage reports in Azure DevOps pipeline
.NET229 titlesCode coverage in .NET Core projects with Azure DevOps
0
I while ago I wrote and article about Publishing .NET Core code analysis to SonarCloud from Azure build pipeline. Although SonarCloud is a great platform for analyzing your code coverage and dry code analysis, it can add additional cost to your project...read more
05
May
2020
Using Polly for retrial policies with Autofac
.NET229 titlesConfguring and using Polly with with pretty much anything
0
Some time ago I wrote an article which explains how to Increase service resilience using Polly and retry pattern in ASP.NET Core. This is a great way how to easily implement retrials when using .NET Core dependency injection, but in case of using Autofac with .NET Framework 4.x you do not have many out of the box solutions. However, Polly as a library is not specifically built for .NET Core and using it with other dependecy injection packages such as Autofac is fairly easy...read more
29
Apr
2020
Validate configurations with FluentValidation in ASP.NET Core
.NET229 titlesValidating IOptions models with FluentValidaton
0
Configuration is an important part of the application. In many cases it determines how the application will behave, for example when you have different configurations per environment...read more
19
Apr
2020
Combining multiple Swagger API endpoints in a single UI
.NET229 titlesMultiple REST API microservices endpoints in a single Swagger UI
0
Shifting from traditional monolithic application architecture to micorservices can solve bunch of problems and issues monolith application application design approach introduces, but on the other hand it has it's own drawbacks, although number of drawbacks compared to number of problems it solves is a lot greater so it makes sense to take a path in process of moving from monolithic to micorservices. On of the steps to move to micorservices is to physically have your services running as individual processes...read more
02
Mar
2020
Overwriting configuration values with environment variable in ASP.NET Core
.NET229 titlesUsing environment specific variables to overwrite configuration values in ASP.NET Core
0
It is obvious that no matter what is the size and complexity of your application, configuration values on your local development machine and the environment where the application is going to run will be different. To avoid any hard-coding and recompilation of your code, the most common practice is to store application and environment specific values to configuration files...read more
01
Mar
2020
Custom SignalR hub authorization in ASP.NET Core
.NET229 titlesASP.NET Core SignalR hub authorization
0
SignalR is number one choice for real-time communication between server and client. It implements several transports for communication between server and client...read more
28
Nov
2019
Using options pattern in MVC5 legacy applications with web.config
.NET229 titlesSimple implementation of options pattern in .NET Framework 4.x legacy applications
0
The story behind New descendant of .NET Framework, .NET Core, comes with one really useful pattern for reading and using configuration files. It comes with out of the box support for JSON configuration files which are much more readable and give much greater freedom and flexibility on how to organize your settings...read more
26
Oct
2019
Ignoring properties from controller action model in Swagger using JsonIgnore
.NET229 titlesExcluding properties from Swagger in controller action input model using Newtonsoft.Json package
0
While designing the REST API, quite often you may find yourself in a situation where the data can be provided from multiple sources, like route, query string or POST/PUT payload. While that might not be a big problem, it may force you to redesign your models and most likely you will end up with keeping your original DTOs but then designing a new model in your application services layer just to have all your data from different sources in one place when you are passing it to the service method.
Resolving multiple sources custom binding
...read more
01
Oct
2019
Strongly typed configuration sections with options pattern in ASP.NET Core
.NET229 titlesLoading configuration values directly to classes and use them in the runtime
0
Configuration is probably the most essential part of every application, yet we do not give much attention to it during application design and development. .NET Core has quite nice way to store configurations (usually JSON files) and already built-in extensions to access configuration values and directly cast them to a specific type...read more
.NET
5
Jun
2022
Using dotnet nuget package vulnerability scan in Azure DevOps build
Listing nuget vulnerabilities and controlling build in Azure DevOps
5
May
2022
Protecting static files in ASP.NET Core using custom middleware
Restricting access to specific static content with middleware in ASP.NET Core
20
Dec
2021
Supporting multiple authentication schemes in asp.net core webapi
Using more than one authentication schemes in webapi projects
12
Dec
2021
Controlling the flow of migrations in EF Core
Altering EF Core migrations execution order
28
Nov
2021
Unit of work pattern with Dapper
Implementing unit of work pattern with Dapper in .NET 5
21
Sep
2021
Adding display name to Enum values
Implementing additional values for Enum items in C#
JavaScript
28
Oct
2018
HTML5 localStorage with expiry with vanilla JavaScript
Using HTML5 localStorage with expiry
8
May
2018
Monitoring DOM changes with JavaScript
Handling DOM changes with plain JavaScript
9
May
2017
Non blocking CSS load on the page
Load external CSS files in an async manner
16
Mar
2017
Serialize html form to JSON without using JQuery
Transform user input from HTML form fields to JSON
17
Jan
2016
Copy text value to clipboard using jQuery
Simple sample of using jQuery to copy value to clipboard
11
Jan
2016
Resize image on the client side with JQuery
Reducing the upload sie by resizing image on the client side
SQL/T-SQL
22
Feb
2022
Select column names with values from SQL Server database
Fetching column names with its value in T-SQL using built in JSON methods
23
May
2020
Identifying opened connections for the specific application in SQL Server
Connection listing queries in SQL Server
3
May
2018
Reading JSON data in T-SQL on SQL Server
Extracting values from JSON string on SQL Server using T-SQL
28
Apr
2016
Create XML/HTML with T-SQL
Generating XML/HTML output in SQL Server
24
Nov
2015
IP address to octets split in TSQL
Split IP addresse into octets in SQL Server
20
Jul
2015
Getting first and last second of the current year, month and day
Using minimum and maximum date time in SQL query
Umbraco CMS
2
Mar
2018
Minify HTML output of your pages
Minification of HTML output using ASP.NET IHttpModule
18
Apr
2015
Generate sitemap.xml on the fly in Umbraco CMS
Simple sitemap.xml Umbraco handler
2
Mar
2015
Accessing UmbracoHelper in HttpHandler request
Working with UmbracoHelper and IPublishedContent in HttpHandler
14
Sep
2014
Same page language switching in Umbraco
Land on the same page in different language in Umbraco using Relations
4
Sep
2014
Getting cropped image the smart way
The way to get cropped image URL with option to load original image too
27
Aug
2014
Fastest way to return JSON result from a controller
Resturn JSON in MVC controller action