Posts
i18n With React Intl and SimpleLocalize
React Intl is a popular internationalization library. This article demonstrates how to set it up in a new React project and how to manage translations with SimpleLocalize.
Send emails with SendGrid
SendGrid is a popular email service provider. The free plan gives you 100 emails/day to play around with the service. The SendGrid Nuget Package makes C# integration easy and smooth. This article will show you how to integrate SendGrid with a Asp.NET Core Web API project.
Serilog Setup With Seq
Seq is built for modern structured logging with message templates. It allows us to search and filter logs with SQL-style queries. If you don’t have paid subscription, you can run Seq on your local machine with Docker. You can use Serilog.Sinks.Seq to send logs to Seq with Serilog. This tutorial will show you how to set it up for your Asp.Net Core application.
Dapper Retry With Polly
While Entity Framework Core has a connection resiliency feature to retry failed database commands, Dapper doesn’t. Ben Hyrman wrote a nice article SQL Server Retries with Dapper and Polly to show us how they use Polly to support this. By following the article, I wrote a tiny sample project for my future reference.
Sync Cosmos DB Collection to Blob Storage with Azure Functions Cosmos DB Trigger
Azure Cosmos DB change feed allows us to listen to all inserts and updates to Cosmos DB collections. Azure Cosmos DB trigger is the easiest way to utilize the feature. This article demonstrates how to sync Cosmos DB collection to Blob Storage with change feed.
Swashbuckle ASP.NET Core Setup
Swagger is a great tool for documenting APIs. This article will show you how to set it up with ASP.NET Core.
HttpClient PostAsync Sample
Make HTTP Requests keeps getting easier with AspNetCore. But the document doesn’t have a sample for
PostAsync
method, which is quite annoying. This article provides a sample for reference.Serilog Setup With Raygun
Raygun is a very popular monitoring tool. Serilog.Sinks.Raygun is a Serilog sink that writes events to Raygun. This tutorial will demo how to set it up for an AspNetCore project.
HttpResponse extension: WriteJsonAsync
This is a brief extension method for
HttpReponse
to write any object in JSON format.Unit Test With xUnit and AutoFixture
AutoFixture is created to minimize the ‘arrange’ phase of your unit tests. Unit Testing: Activate Easy Mode shows me how easy it is to write unit tests when you have the correct toolsets. My demo program follows the same idea, but with my favorite libraries.
Serilog Setup for AspNetCore
Serilog is one of the most popular logging libraries. This tutorial will show you how to set it up for an AspNetCore project.
Symmetric Encryption With Aes
There are many symmetric encryption algorithms in .NET world. I created a demo project with Aes.
Azure Blob Storage Zip Archive
I created a tiny project which provides a Web Api endpoint to download files from Azure Blob Storage as zip archive. In this article, I will explain some fo the important pieces.
IdentityServer4 Tutorial - Part 3: Store Refresh Token in Cosmos DB
By default refresh tokens are stored in memory. In this tutorial we will add an
IPersistedGrantStore
implementation to store refresh tokens in Cosmos DB. Cosmos DB provides 5 APIs. We will use SQL API with Version 3.0+ of the Azure Cosmos DB .NET SDK. The work is based on IdentityServer4 Tutorial - Part 2: Resource Owner Password Grant Type.IdentityServer4 Tutorial - Part 2: Resource Owner Password Grant Type
This tutorial will show you how to configure a client to use Resource Owner Password grant type. The work is based on IdentityServer4 Tutorial - Part 1: Basic Setup.
IdentityServer4 Tutorial - Part 1: Basic Setup
IdentityServer4 is one of the most popular OpenID Connect and OAuth 2.0 framework for ASP.NET Core. This tutorial will show you how to build an authentication server with the library.
Self Signed Certificate With Powershell
Powershell makes generating a new self-signed certificate quite easy. With one simple command, you can have one installed on your machine. A PFX file can be exported for other usages.
Owin Middleware With Params Parameters
Recently I tried to create a simple Owin middleware with params parameters.
Travel Plan: Bundling with webpack
In last article I built a simple Travel Plan web app with React. All Javascript code were wrote directly inside script tag. In this article I will use webpack to bundle my front end resources.
Travel Plan: React Basic
‘Travel Plan’ is a simple web app I implemented by following the tutorial on React official website. It uses basic React functions and Google Map Javascript APIs.
How to Start ReactJS Development
I started learning ReactJS about two months ago. Recently I built one simple SPA (Single Page App) with React-Router and Flux.
Payment Express Pxpay With Httpclient And Linq To Xml
Payment Express is one of the most popular payment gateways based in New Zealand. PxPay provides handy APIs for Auth, Purchase, and Token Billing. All APIs use XML format for data exchange. This article shows you how I use HttpClient and LINQ to XML to consume those APIs.
A Large Number Of Values In An In Clause
Using a large number of values in an IN clause is not recommended. It is time consuming and may result in an error. Out of curiosities I ran two simple tests against this.
Export Data As Csv
CSV is a common format for data exchange. It stands for “Comma Separated Values”. Values need to be double-quoted if they contain comma, double quotes, leading or trailing spaces. The format is actually quite simple. We can generate one easily with StringBuidler.
Camelcase Json Result Wth Json Net
.NET has PascalCase naming convention for properties while Javascript has camelCase. Is there an easy way to convert the Json result? The answer is Json.NET. This article will show you how to create a custom result with Json.NET.
Google Distance Matrix Api With Httpclient And Json Net
Google Map is excellent. So is Google Map API. This article will create a simple class with HttpClient and Json.NET to utilise Google Distance Matrix API.
Front End Automation With Gulp
Gulp is a great tool for front end automation tasks. In this article I will show you how I use Gulp to boost my front end development efficiency.
Model Binding To Collections
It is quit often we want to post a list of data to an action to save them. Ideally ASP.NET MVC Model Binding should be able to deal with this scenario. It should bind them into a list of data entities. And yes! Model Binding does offer us this convenicency. You can check out references below for more details. In this post, I will show how I use this feature with jQuery Ajax Post.
Pagination With Partial View
This pagination feature with partial view was inspired by Adam Freeman’s pagination html helper in his book
<Pro ASP.NET MVC 5>
. Instead of using html helper, I implemented it with a partial view so I could customize the content and style easily.Implement Show More Button For A Task List
To limite page size, we only want to list a limited number of items at first. And then click Show More button to render more items. We can use partial view to reuse our code. In this example we will implement a simple task list.
Generate A Dropdown List For Enum
We often use an Enum in C# to define all options for a field, such as a category Enum:
And we need a dropdown list for this category field. How would you implement this?
Custom Validator For ASP.NET MVC: MustBeTrue
Recently I was working on a small project to add a checkbox for users to accept Terms and Conditions during registration. In order to use the built-in validation functions by ASP.NET MVC, I wrote a small custom validator for this: MustBeTrue.
ASP.NET Web Development With Visual Studio 2015 and Local IIS 7 on Windows 7
Visual Studio 2015 provides ASP.NET web development environment directly with IIS Express. It is very straight forward to start web development with this setting. But if you ever used Visual Studio 2015 with Local IIS, you would find that it is much more convenient and you would love it.
Magento 1 Development Environment Setup
There is an advanced Magento development environment setup tool implemented by davidalger. But I’d like to keep my env simple and basic:P So I decided to make my own.
subscribe via RSS