
Image from Pexels
Tagged articles - .NET
Found 104 articles tagged with .NET
14
Jan
2018
JavaScript base64 image to Bitmap in C#
.NET229 titlesConverting base64 image string to Bitmap in C#
0
Base64 serialized images are useful in many cases for serving images on page. It is also a format of image that JavaScript can generate on the fly.
HTML canvas object has native support for base64 and it can be easily serialized to base64 string from JavaScript code by invoking toDataURL method of the canvas element.
...read more
13
Jan
2018
Separate configuration files per build config in Visual Studio IDE
.NET229 titlesGenerating different configuration files on the build time in VS IDE
0
It is an often case that application configuration is different for each environment. Most often this is the case for database connection string where developer has connection string to dev environment database or it's local database and quality assurance (qa) and production have different connection strings wile the rest of the config...read more
11
Jan
2018
Manage IIS website from ASP.NET code
.NET229 titlesControlling the current ASP.NET application running on IIS from the code
0
Microsoft made IIS management from the ASP.NET code itself much easer and accessible right out of the box by introducing Microsoft.Web.Administration library. Simply by adding the reference in your project to Microsoft.Web.Administration library you are getting options to manage websites hosted on the IIS where application is running. One of the requirements beside referencing Microsoft.Web.Administration library is setting your Application Pool to run under LocalSystem account.
...read more
24
Dec
2017
Using GZip compression for large text values in Redis
.NET229 titlesStore and retrieve larger text values with Redis in .NET
0
Using REDIS for caching values for increasing application performance can be quite beneficial and can increase performance and scalability of your application. Although REDIS allows quite large text files, up to 512MB which is something you most likely will not reach if you are storing for example JOSN data, there will be a significant network transfer over the wire for putting and pulling this value in and out...read more
09
Oct
2017
QR code MVC html helper
.NET229 titlesDisplay runtime generated QR code in MVC page
0
This article is based on one of my previous topic Advanced Base64 image extension in ASP.NET MVC. It uses the same concept to display image on the page and to cache it, but it involves QR code bitmap generation which is basically a NuGet package use.
Basically, QR code is generated using NuGet package QRCoder https://www.nuget.org/packages/QRCoder/ and result Bitmap is serialized to base64 string and cached so we do not regenerate same QR bitmap over and over on every request which may lead to server overload.
...read more
20
Sep
2017
Clean stop of Windows Service in .NET
.NET229 titlesStop Windows Service in the proper manner in C#
0
The common reason I wrote Windows Services applications for are usually workers. For example, you need to read messages from the queue and process them...read more
13
May
2017
Advanced Base64 image extension in ASP.NET MVC
.NET229 titlesAdvanced base64 image rendering in a Razor in ASP.NET MVC
0
Serializing images to base64 string is well known technique to reduce requests per page. Each image on the page produces a separate request while page is loading...read more
12
May
2017
ASP.NET Core Web API versioning
.NET229 titlesSimple way to setup versioning in ASP.NET Core WebAPI
0
When it comes to WebAPI many project overlook the versioning aspect. The whole concept of WebAPI is to serve multiple types of clients which can be based on different platforms, run on different devices etc...read more
24
Apr
2017
Google Service Account authentication in .NET
.NET229 titlesAuthenticate app with service account for working with Google services
0
In case you are a .NET developer and you are using Google Cloud platform, eventually your apps or services will have to interact with Google Cloud (GCE) services. Good thing is that complete GCE is exposed through REST API.
Whole authentication is done through OAuth 2.0, but the authentication of website applications and your services which might be running in background on your server is not the same...read more
23
Dec
2016
Dictionary to object in C#
.NET229 titlesCreate an object from dictionary collection
0
Dictionaries are very useful as data holders for any type of the code in C#. You can easily manipulate data stored on collections, but there are disadvantages like posting data to REST JSON service...read more
17
Dec
2016
Simple Office365 authentication
.NET229 titlesUse Office365 account login for your application
0
With so many online and cloud based services, adding one more additional account for your application adds additional complexity level for your users since they will have to manage one more account and remember one more password.
Microsft ASP.NET comes with pretty nice built in provides for social networks, but for office usage social networks are not so convenient to be used.
...read more
27
Mar
2016
MSMQ recovery with .NET
.NET229 titlesUsing MSMQ with message recovery in .NET
0
MSMQ is a bit old stuff and there are bunch of other products out here which perform better in most of the scenarios, but MSMQ is still used in a lot of solutions and Microsoft still did not announce support ending for MSMQ so it will be for sure some more time around.One of the stuff that is missing as out of the box feature in MSMQ is recovery. In scenarios you get the message from the queue and try to process, and process fails, in some of the cases you might want to try to process the message again...read more
02
Feb
2016
Serialize DataTable to JSON with just few lines of code
.NET229 titlesGenerate JSON string from DataTable in C#
0
Although JSON is widely used as a format for sharing the data, there are still existing solutions or modules that still rely on ADO and DataTables. Even today it very common to see some piece of code which deals with DataTable or DataReader for the performance reasons.
In the end if any of the ADO objects needs to be exposed as a JSON string you have to write your own serialization code.
...read more
13
Jan
2016
Simplified FileAttributes usage with extension methods
.NET229 titlesUseful extension methods for common used file and folder attributes
0
In case you are working on a small project where you just store some files and access them, you do not really need a database to achieve accessibility and additional info to files or folders. File-system itself is providing some stuff which can be useful for this...read more
03
Jan
2016
SqlBulkCopy with model classes in C#
.NET229 titlesUse SqlBulkCopy with model (POCO) classes in C#
0
So far (based on my experience) the fastest way to insert big number of records from application to database is to use SqlBulkCopy. The downsize of this is that SqlBulkCopy uses DataTable instace as an input parameter which is not so convenient when dealing with models which are strongly typed and a lot more easy to use than iterating through the DataTable...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