Tagged articles - C#
Found 179 articles tagged with C#
01
Oct
2019
Strongly typed configuration sections with options pattern in ASP.NET Core
.NET200 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
04
Sep
2019
Mixed model binding in ASP.NET Core using custom model binders
.NET200 titlesIModelBinder interface implementations usage for multiple source model binding
0
Patterns, conventions and standards are invented and enforced in order to make coding easier and more understandable for the developers, but in some cases certain patterns and conventions do not couple so easily and you have to rely on more on the actual technology you are using in order to overcome these complications.
One of the cases this happens is using CQRS, especially commands and REST. Although commands give clear separation of intention of some action, at the same time commands are especially tough to handle in soma cases because of their immutability...read more
31
Aug
2019
Handling file uploads in Swagger UI with ASP.NET Core
.NET200 titlesSwagger UI file upload in ASP.NET Core WebApi
0
Swagger is the most convenient way to document your REST api endpoints. It provides generating of documentation on the fly based on the code structure, which shortens the time of creating the documentation drastically...read more
28
Aug
2019
Monitoring Redis key events in .NET Core
.NET200 titlesKey event subscriptions for DEL, SET, EXPIRED key events in Redis using .NET Core
0
Some time ago I wrote an article about Reloading the cache automatically once expired is ASP.NET MVC. The piece of code represented in that article is build on top of .NET Framework 4.7.2...read more
05
Jun
2019
Stop writing clients in C# for your Web APIs
.NET200 titlesAuto generating client libraries and packages for Web API using NSwag and Azure DevOps
0
Times of writing your HttpClient setup to call REST API endpoint are over. It is just to much of repetitive code and taking care of the endpoints of the REST API service...read more
26
May
2019
Publishing .NET Core code analysis to SonarCloud from Azure build pipeline
.NET200 titlesHow to get your code analysis in SonarCloud directly from Azure DevOps build pipeline
0
Code analysis is and important part of application development. It can point to a potential bottle necks or code cluttering during the development process...read more
19
May
2019
Automatic CQRS handler registration in ASP.NET Core with reflection
.NET200 titlesRegistering all query and command handlers in your CQRS implementation in ASP.NET Core
0
Command Query Responsibility Segregation (CQRS) pattern is one of my favorite way of handling the Web API requests for a simple reason that is clearly separates reading and writing. Quite often at some stage of the project you will hit the performance bottlenecks which are most probably cause by the way you are reading ow writing your data.
CQRS splits reading and writing so that you can independently use different persistence framework for reading and writing...read more
08
Apr
2019
Why you should not use Authorize attributes to protect your API endpoints
.NET200 titlesProtecting ASP.NET Core WebAPI without using Authorize attribute
0
Authentication is an essential component of pretty much any REST API. Most of the resources you expose through REST API services, unless they are protected inside intranet, need to be protected by some kind of authentication.
This is pretty much clear and it is easy achieved by just simply decorating your controller actions or even whole controllers with Authorize or AllowAnonymous attributes. ...read more
26
Mar
2019
DTO comments from external assembly in Swagger documentation in ASP.NET Core
.NET200 titlesInvolving contract classes documentation from separate assemblies to Swagger
0
Contracts, models or DTOs, call them how ever you want, are your connection with the outside world from your REST API. Consumers of your API depend on them and they know what to expect or what your API endpoints expect in communication...read more
12
Mar
2019
Managing images on filesystem using Repository pattern in .NET Core
.NET200 titlesRepository pattern in action for managing files
0
It is not uncommon that for records in database you need to store image files or other documents related to the specific record on the file system. Storing documents related to the database records on the file system is not a silver bullet...read more
25
Feb
2019
Reading coordinates from the photo in .NET Core
.NET200 titlesAccessing GPS coordinates metadata of a photography using C# and .NET Core
0
Pretty much all models of digital cameras including smartphones have ability and usually by default store additional metadata along with the image itself taken. This data is stored in EXIF format and you can easily see it if you are a Windows user by checking the properties of the photography file.
...read more
21
Feb
2019
Making reflection in .NET Core work faster
.NET200 titlesTechniques for optimizing reflection in C#
0
Reflection allows accessing type structure and its meta-data in runtime. Using reflection, you can dynamically instantiate objects, access fields, methods and properties regardless of the protection level...read more
04
Feb
2019
How to have a REST with Azure serverless functions
.NET200 titlesBuilding REST API services with Azure Functions Serverless model
0
Serverless model is becoming more and more popular everyday and all major cloud providers like AWS, Azure and GoogleCloud are providing their own implementation of serverless cloud computing model. As more and more companies are shifting their infrastructure to cloud, serverless model becomes more and more popular mostly because it's cost effectiveness, easy setup and out of the box scaling and orchestration...read more
21
Jan
2019
Speech to text mp3 audio files using Azure Cognitive Services and .NET Core
.NET200 titlesTranscribe mp3 audio files to text using Azure SpeechServices and C#
0
There is a big buzz about AI these days and major Cloud vendors like Amazon Web Services, Azure, Google Cloud are competing to bring better products to their platforms for variety of AI tasks. One of these services is speech recognition and generating transcription text from the audio.
I recently worked on a project which involved transcribing large amount of daily generated audio recordings...read more
04
Jan
2019
SqlBulkCopy object collection to database table with C#
.NET200 titlesPerforming SqlBulkCopy with collection of objects as a source data
0
Over the time various techniques to manipulate database data have evolved in .NET. Entity Framework is certainly the most advanced one, but for small ad hock applications where you have few inserts to deal with, ADO is still the fastest way to write data to the database...read more
.NET
28
Nov
2019
Using options pattern in MVC5 legacy applications with web.config
Simple implementation of options pattern in .NET Framework 4.x legacy applications
26
Oct
2019
Ignoring properties from controller action model in Swagger using JsonIgnore
Excluding properties from Swagger in controller action input model using Newtonsoft.Json package
15
Oct
2019
Increase service resilience using Polly and retry pattern in ASP.NET Core
Retry pattern in ASP.NET Core with Polly
1
Oct
2019
Strongly typed configuration sections with options pattern in ASP.NET Core
Loading configuration values directly to classes and use them in the runtime
10
Sep
2019
Unit testing repositories in ASP.NET Core with xUnit and Moq
Mocking UserManager RoleManager and DbContext in unit tests in .NET Core
4
Sep
2019
Mixed model binding in ASP.NET Core using custom model binders
IModelBinder interface implementations usage for multiple source model binding
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
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
13
Apr
2015
Dealing with duplicate rows in SQL Server
Finding and cleaning up duplicate rows in SQL Server tables
12
Mar
2015
Reducing the number of Stored Procedures for the Application
Approach to reduce number of stored procedure for the application
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