In this article, we are going to learn how to convert DateTime to ISO 8601 string in C#. There are various formats of ISO 8601 compliant date and time strings. We are going to build a console application and explore all these different formats.
In one of our C# applications, we recently came across a requirement to add a watermark to a pdf document. In this article, we are going to look at how we can achieve this using iText7 and another alternate way to easily do this using KiproshWatermarkingPDF
Sometimes, we want to combine arrays in such a way that they are "braided" or "zipped" together, so that they alternate back and forth between various types of entities. We could imagine some function BraidArrays that could do this for us. (I'll do it in C#, since thats the language this blog post is headed in
In this article, we are going to discuss how we can use the logging API in a .NET application and the three important interfaces of this API – ILogger, ILoggerFactory, and ILoggerProvider. Logging is an important part of every application. It helps us identify the issues in our application when we face any problems in production.
Today we are shipping a Preview 12 of .NET Multi-platform App UI with many quality improvements and some new capabilities. As we near shipping our first stable release, the balance of work begins to shift towards quality improvements and stabilization, though there are still some interesting new things to highlight including...
You secure sensitive data when stored in a database, but are you securing sensitive data in an event or message driven architecture? For example, if you need to include Credit Card information in a message for a queue to be processed. But need to be compliant with PCI-DSS! You can encrypt the actual message or a portion of the message, or if the broker supports it, use server-side encryption.
Raise your hand if you've stored entity values in a database as DateTime. Ok, everybody has their hand up. You can put your hand down - you look silly doing that while reading an article on some website. Using DateTime for entity properties and database fields is ubiquitous, but if you really care about the time portion of the value, it's often ambiguous. What time zone is the date in? Is it stored as UTC? From everywhere that touches it? How can you be sure? DateTimeOffset provides a solution to this problem.
Guard Clauses provide an elegant way to ensure code inputs are valid, typically by throwing exceptions. Validation provides a solution to a similar problem, typically without the use of exceptions. When does it make sense to use each of these techniques? This article is a response to a question I received from one of my tips newsletter subscribers, Chad Boettcher.
In this article, we are going to learn about different ways to catch multiple exceptions in C#. Utilizing try-catch block is the best way to manage exceptions. It also enables developers to manage exceptions however they want. Using a single catch block is one of the models which we can use to...
This post is part 2 of a 3-part series. You might want to read Part 1 first.We know from the previous post in this series that in order to make a dependency injectable into another code object, the dependency must: Have an abstraction (most commonly an interface)...
In this post, we are going to learn about serializing objects to XML in C#. So, what is XML Serialization? It is the transformation of the public fields and property values of an object (without type information) into an XML stream.
Welcome to a brand new series! We're going to dive into how .NET does Dependency Injection, and how we can use it to make our apps much nicer to change. Let's go!
Value Objects are a key part of Domain-Driven Design and domain models created by this process. However, they're not used nearly as often by teams as they should be, and they're frequently misunderstood even by experienced dev teams. When teaching teams how to better understand Value Objects and incorporate them more in their domain models, I've found the DateTime .NET type to be a useful example.
如何通过Jenkins完成镜像分发？基本做法是：打包镜像→上传镜像到仓库→脚本分发。镜像仓库也有很多，比如docker hub、Harbor等，今天这一篇讲一下基于阿里云镜像仓库的操作。首先，准备一个阿里云镜像仓库，个人版是免费的。然后下载这个插件：Publish Over SSH这个插件主要用来远程登录服务器并执行脚本。插件安装完毕后，系统设置会多出这一项，戳图里这个按钮：然后，把服务器的ip、账户、密码填进去：配置好以后，最好点测试按钮试一下，如果没问题会输出“Success”接下来找到之前的工作流，新增构建步骤：选中刚才新增的server，编写脚本进行上传...