What I've learned from 20 years of programming in C# with Joe Albahari with Q&A session - YouTube
In April 2001, I wrote and published my first C# program. Join me in discovering the most valuable principles that I've learned in the 20 years of C# programming that followed. We'll cover a range of topics, with plenty of samples and useful code that you can take away.
00:00 - Introduction
01:04 - Types
18:55 - Functional Programming
19:43 - What Defines Functional Programming?
33:26 - Lazy Values
36:20 - Cache a function - Memoizer
41:49 - Using a Closure instead of a Class
43:24 - Memoizer example
45:07 - Asynchronous Programming
47:58 - How do we abstract around Futures?
53:54 - Asynchronous locking
58:04 - Implementing A-synch lock with Semaphore
01:09:48 - Await inside a UI method vs a library method
01:18:04 - Using Exceptions
01:36:18 - Implementing a Retry
01:39:02 - IEither interface
01:39:58 - Downloading samples on LINQPad
01:40:27 - Q&A Session
Immutability comes with a lot of benefits, but sometimes it can be a bit cumbersome to deal with when you only want to update some properties. Since the object is immutable, you need to create a copy with all the existing values and the new updated one.
I will show you how Records in C# 9 will greatly simplify this
- Update build tools to match .NET 6 Preview 3 SDK. (PR: omnisharp-roslyn#2134)
اگر به مبحث CQRS علاقمند هستید و میخواهید بطور کامل و درست اونو تو پروژههای خودتون پیاده سازی کنید و از پرفرمنس اپلیکیشن خود راضی باشید، ریپازیتوری ای را که معرفی میکنم، دنبال کنید.
یکی از مزایای CQRS ، Scalability است. بدون Scale کردن ، کل اپلیکیشن ما درون یک سرور قرار دارد و تنها به منابع یک سرور محدود میشود. با گذشت زمان و رشد اپلیکیشن منابع بیشتری مورد نیاز خواهد بود و باید این سرور را قویتر کنیم که این ماجرا هزینه بر است.
چونکه عملیات خواندن بیشتر از نوشتن، آپدیت و حذف اطلاعات درخواست میشود درنتیجه بار بیشتری روی کوریهای اپلیکیشن هست ، پس جداسازی دیتابیسهای Query و Command میتواند تاثیر چشمگیری در سرعت و کارایی اپلیکیشن شما داشته باشد.
بدین ترتیب میتوانیم برای عملیات Read ، سرور را قویتر و برای باقی عملیات از سرورهای ضعیفتر استفاده کنیم و این چیزی است که توسط Scalability فراهم میشود.
در این پروژه کانتکستها و ریپازیتوریهای خواندن و نوشتن جدا شده است و به این ترتیب میتونید در Query ها از کانتکست یا ریپازیتوری خواندن و در Command ها از کانتکست یا ریپازیتوری نوشتن استفاده کنید.
یک راه برای جداسازی دیتابیسهای خواندن و نوشتن استفاده از تکنیک Always On اسکول سرور است که بعد از پیاده سازی آن، شما میتوانید کانکشن استرینگهای دیتابیسهای خود را در فایل appsettings.json قرار داده و دیتابیس Command و Query اپلیکیشن خود را بدین ترتیب جدا سازی نمایید.
راه حل دیگر میتواند این باشد که در پیاده سازی ریپازیتوری خواندن خود از Dapper برای کوری گرفتن استفاده کنید که کارایی و سرعت آن در مواردی به مراتب بیشتر از ef است.
یک راه بهتر می تواند طراحی دیتابیسی باشد که جداول Denormal و Flat داشته باشد که تمام فیلدهای مورد نیاز درون آن قرارگیرد. سپس با هر بار درج اطلاعات در دیتابیس Command این جداول نیر آپدیت شوند. با داشتن این جداول دیگر نیاز به Join های عجیب و غریب SQL نداریم.
بسته به بیزینس مورد نظر و منابع موجود میتوانید از تکنیک ها، ابزارها و دیتابیسهای دیگری هم در پیاده سازیهای خود استفاده کنید.
- Prompt user to install Blazor WASM companion extension if needed (PR: #4392)
- Add properties to blazorwasm debug configuration. (dotnet/aspnetcore#30977, PR: #4445)
- Updated Razor support (PR: #4470)
Moving the standards work into the open, under the .NET Foundation, makes it easier for standardization work. Everything from language innovation and feature design through implementation and on to standardization now takes place in the open. It will be easier to ask questions among the language design team, the compiler implementers, and the standards committee. Even better, those conversations will be public.