PostgreSQL 17 منتشر شد
- Overhauled memory management for vacuuming, resulting in significantly lower memory usage and running time. More on this here.
- Incremental backup support.
- Faster B-tree index scans.
- MERGE enhancements, including view support.
- New functions to extract elements from UUIDs.
- WAL improvements – up to 2x write throughput on some workloads.
- Improvements to SQL/JSON support, including JSON_TABLE.
- Bulk loading improvements and perf improvements for COPY which gains the ON_ERROR ignore option to ignore errors.
- Identity columns on partitioned tables.
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.
The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.
React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way, we'll show test-driven development and emphasize tips and tricks in the IDE.
Other videos from this series:
1. Project Setup: https://youtu.be/wm8WdAB64gw
2. Project Cleanup: https://youtu.be/b0KrB31hN5k
3. Testing: https://youtu.be/Y_TGIsFnvo4
4. Debugging Node.js: https://youtu.be/r1kwXZnO8gw
5. Debugging in Chrome: https://youtu.be/dvmZi_DWu9I
6. TSX and ES6: https://youtu.be/JXrZDUzkc2Q
7. Class Props: https://youtu.be/HYmoeUF9ZH0
8. Class State: https://youtu.be/21-VMTmiV8E
9. Rich Events and Testing: https://youtu.be/OO7OmA5UlQM
10. Presentation Components: https://youtu.be/SnCGW6JUo4E
انتشار automapper نسخه 9.0
ASP.NET Core 3x دیگر به صورت پیشفرض به همراه Json.NET ارائه نمیشود
در برنامههای ASP.NET Core 3x، وابستگی ثالث Json.NET حذف شدهاست و از این پس هر نوع خروجی JSON آن، مانند بازگشت مقادیر مختلف از اکشن متدهای کنترلرها، به صورت خودکار در پشت صحنه از امکانات ارائه شدهی در System.Text.Json استفاده میکند و دیگر Json.NET، کتابخانهی پیشفرض کار با JSON آن نیست. بنابراین برای کار با آن نیاز به تنظیم خاصی نیست. همینقدر که یک پروژهی جدید ASP.NET Core 3x را ایجاد کنید، یعنی در حال استفادهی از System.Text.Json هستید.
روش بازگشت به Json.NET در ASP.NET Core 3x
اگر به هر دلیلی هنوز نیاز به استفادهی از کتابخانهی Json.NET را دارید، آداپتور ویژهی آن نیز تدارک دیده شدهاست. برای اینکار:
الف) ابتدا باید بستهی نیوگت Microsoft.AspNetCore.Mvc.NewtonsoftJson را نصب کنید.
ب) سپس در کلاس Startup، باید این کتابخانه را به صورت یک سرویس جدید، با فراخوانی متد AddNewtonsoftJson، معرفی کرد:
public void ConfigureServices(IServiceCollection services) { services.AddControllers() .AddNewtonsoftJson() // ... }
روش کار مستقیم با System.Text.Json
اگر در قسمتی از برنامهی خود نیاز به کار مستقیم با اشیاء JSON را داشته باشید و یا حتی بخواهید از این قابلیت در برنامههای کنسول و یا کتابخانهها نیز استفاده کنید، روش انتقال کدهایی که از Json.NET استفاده میکنند به System.Text.Json، به صورت زیر است:
public class Person { public string FirstName { get; set; } public string LastName { get; set; } public DateTime? BirthDay { get; set; } }
using System; using System.Text.Json.Serialization; namespace ConsoleApp { class Program { static void Main(string[] args) { Person person = JsonSerializer.Parse<Person>(...); string json = JsonSerializer.ToString(person); } } }
کلاس JsonSerializer دارای overloadهای زیر برای کار با متدهای Parse و ToString است:
namespace System.Text.Json.Serialization { public static class JsonSerializer { public static object Parse(ReadOnlySpan<byte> utf8Json, Type returnType, JsonSerializerOptions options = null); public static object Parse(string json, Type returnType, JsonSerializerOptions options = null); public static TValue Parse<TValue>(ReadOnlySpan<byte> utf8Json, JsonSerializerOptions options = null); public static TValue Parse<TValue>(string json, JsonSerializerOptions options = null); public static string ToString(object value, Type type, JsonSerializerOptions options = null); public static string ToString<TValue>(TValue value, JsonSerializerOptions options = null); } }
سفارشی سازی JsonSerializer جدید
اگر به امضای متدهای Parse و ToString کلاس JsonSerializer دقت کنید، دارای یک پارامتر اختیاری از نوع JsonSerializerOptions نیز هستند که به صورت زیر تعریف شدهاست:
public sealed class JsonSerializerOptions { public bool AllowTrailingCommas { get; set; } public int DefaultBufferSize { get; set; } public JsonNamingPolicy DictionaryKeyPolicy { get; set; } public bool IgnoreNullValues { get; set; } public bool IgnoreReadOnlyProperties { get; set; } public int MaxDepth { get; set; } public bool PropertyNameCaseInsensitive { get; set; } public JsonNamingPolicy PropertyNamingPolicy { get; set; } public JsonCommentHandling ReadCommentHandling { get; set; } public bool WriteIndented { get; set; } }
// Json.NET: var settings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }; string json = JsonConvert.SerializeObject(person, settings);
// JsonSerializer: var options = new JsonSerializerOptions { IgnoreNullValues = true }; string json = JsonSerializer.ToString(person, options);
در برنامههای ASP.NET Core که این نوع متدها در پشت صحنه فراخوانی میشوند، روش تنظیم JsonSerializerOptions به صورت زیر است:
services.AddControllers() .AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true);
نگاشت نام ویژهی خواص در حین عملیات deserialization
در مثال فوق، فرض شدهاست که نام خاصیت BirthDay، دقیقا با اطلاعاتی که از رشتهی JSON دریافتی پردازش میشود، تطابق دارد. اگر این نام در اطلاعات دریافتی متفاوت است، میتوان از ویژگی JsonPropertyName برای تعریف این نگاشت استفاده کرد:
[JsonPropertyName("birthdate")] public DateTime? BirthDay { get; set; }
var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; string json = JsonSerializer.ToString(person, options);
در این بین اگر نمیخواهید خاصیتی در عملیات serialization و یا برعکس آن پردازش شود، میتوان از تعریف ویژگی [JsonIgnore] بر روی آن استفاده کرد.
مدرسه هوش مصنوعی
Dive in and learn how to start building intelligence into your solutions with the Microsoft AI platform, including pre-trained AI services like Cognitive Services and Bot Framework, as well as deep learning tools like Azure Machine Learning, Visual Studio Code Tools for AI, and Cognitive Toolkit. Our platform enables any developer to code in any language and infuse AI into your apps. Whether your solutions are existing or new, this is the intelligence platform to build on.
First it is important to recognize that the .NET Framework is not the same as .NET Core. The .NET Framework is effectively now in maintenance mode , and all innovation is occurring in the open source .NET Core now and into the future. So step one to remaining relevant is to understand .NET Core (and the closely related .NET Standard).
Browser Preview for VS Code enables you to open a real browser preview inside your editor that you can debug. Browser Preview is powered by Chrome Headless, and works by starting a headless Chrome instance in a new process. This enables a secure way to render web content inside VS Code, and enables interesting features such as in-editor debugging and more!
کتاب Visual Studio 2015 Succinctly
In Visual Studio 2015 Succinctly, author Alessandro Del Sole explains how to take advantage of the highly anticipated features in Microsoft Visual Studio 2015. Topics include sharing code between different types of projects, new options for debugging and diagnostics, and improving productivity with other services in the Visual Studio ecosystem, such as NuGet and Azure.