你的位置: 首页 / 资讯列表 / 分类资讯

最新.NET/.NET Core/Web开发资讯源


25 热度

Convert DateTime to ISO 8601 String in C#

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.

收录时间: 2022-01-21
分类: C#
贡献者: Rector
29 热度

將 ASP.NET Core 6 轉成 Windows Service

昨天介紹了只用 50 行的 Program.cs 程式寫出一個支援 CORS 上傳案的 ASP.NET Core 服務,下一步我想把它轉成 Windows Service 常駐執行。

收录时间: 2022-01-20
分类: ASP.NET Core
贡献者: Rector
35 热度

用 50 行 Program.cs 寫個 ASP.NET Core CORS 上傳服務

寫 JavaScript 在別人家的網頁跑,若想將產生結果存成本機檔案,有一些做法,例如:產生一個 href 為 Data URI 的連結供點選下載(範例:用 100 行實現 HTML5 可存檔塗鴉版)、靠伺服器端程式實現自動下載 (範例:Canvas.toDataURL()另存檔案)... 等等。但想要做到不知不覺將檔案寫到本機的指定資料夾,基於安全考量,通常會被瀏覽器禁止。

收录时间: 2022-01-20
分类: ASP.NET Core
贡献者: Rector
28 热度

Watermark PDF using Kiprosh PDF library and iText7 in C#

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

收录时间: 2022-01-20
分类: C#
贡献者: Rector
27 热度

Braiding, Combining, Zipping, or Merging Arrays in C# Generically

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

收录时间: 2022-01-20
分类: C#
贡献者: Rector
33 热度

ILogger, ILoggerFactory, and ILoggerProvider in .NET

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.

收录时间: 2022-01-20
分类: .NET
贡献者: Rector
AD 友情赞助
33 热度

Announcing .NET MAUI Preview 12

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...

收录时间: 2022-01-20
分类: .NET
贡献者: Rector
27 热度

Securing Sensitive Data in an Event Driven Architecture

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.

收录时间: 2022-01-20
分类: 架构设计
贡献者: Rector
23 热度

Why Use DateTimeOffset

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.

收录时间: 2022-01-20
分类: .NET
贡献者: Rector
22 热度

Guard Clauses and Exceptions or Validation?

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.

收录时间: 2022-01-20
分类: .NET
贡献者: Rector
19 热度

Catch Multiple Exceptions in C#

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...

收录时间: 2022-01-20
分类: C#
贡献者: Rector
21 热度

Dependency Injection in .NET 6 - Adding and Injecting Dependencies

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)...

收录时间: 2022-01-20
分类: .NET 6
贡献者: Rector
32 热度

Required Query String Parameters in ASP.NET Core

In this article, we’re going to talk about required query string parameters. We are going to learn how to make query string parameters mandatory and explore the options we have in ASP.NET Core.

收录时间: 2022-01-18
分类: ASP.NET Core
贡献者: Rector
29 热度

Serializing Objects to XML in C#

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.

收录时间: 2022-01-18
分类: C#
贡献者: Rector
71 热度

API Versioning in ASP.NET Core

In this article, we’re going to talk about API versioning and explore the options we have in ASP.NET Core.To download the source code for this article, you can visit our GitHub repository.

收录时间: 2022-01-12
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助
55 热度

Dependency Injection in .NET 6 - Intro and Background

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!

收录时间: 2022-01-12
分类: .NET 6
贡献者: Rector
42 热度

DateTime as a Value Object

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.

收录时间: 2022-01-12
分类: .NET
贡献者: Rector
65 热度

.NET 微服务——CI/CD(3):镜像自动分发

如何通过Jenkins完成镜像分发?基本做法是:打包镜像→上传镜像到仓库→脚本分发。镜像仓库也有很多,比如docker hub、Harbor等,今天这一篇讲一下基于阿里云镜像仓库的操作。首先,准备一个阿里云镜像仓库,个人版是免费的。然后下载这个插件:Publish Over SSH这个插件主要用来远程登录服务器并执行脚本。插件安装完毕后,系统设置会多出这一项,戳图里这个按钮:然后,把服务器的ip、账户、密码填进去:配置好以后,最好点测试按钮试一下,如果没问题会输出“Success”接下来找到之前的工作流,新增构建步骤:选中刚才新增的server,编写脚本进行上传...

收录时间: 2022-01-06
分类: 微服务
贡献者: Rector
63 热度

What are Abstractions in Software Development

Software developers deal with abstractions every day. But just what is an abstraction? There are differing definitions that can sometimes cause confusion. Let's consider a few of them.

收录时间: 2022-01-06
分类: 程序人生
贡献者: Rector
93 热度

Polymorphism in C#

In this post, we are going to learn about the different types of polymorphism in C#, how they work and how we can use them in our code.

收录时间: 2022-01-06
分类: C#
贡献者: Rector
AD 友情赞助