اشتراک‌ها
پروژه TechDebtAttributes

Add attributes to your production code where you find technical debt that you can not currently fix

پروژه TechDebtAttributes
نظرات اشتراک‌ها
SQL Server® 2014 Service Pack 1 منتشر شد
... هنگام ارسال درست بود. علتش را اینطور عنوان کردند:
Notice: There is an issue with SQL Server 2014 SP1 installation if SSIS catalog is present. The package download is temporarily unavailable while the issue is investigated. We will update this page when it is available again. 
مطالب
ایجاد ServiceLocator با استفاده از Ninject
در پست قبلی روش استفاده از ServiceLocator رو با استفاده از Microsoft Unity بررسی کردیم. در این پست قصد دارم همون مثال رو با استفاده از Ninject پیاده سازی کنم. Ninject ابزاری برای پیاده سازی Dependency Injection در پروژه‌های دات نت است که کار کردن با اون واقعا راحته. برای شروع کلاس‌های Book و BookRepository  و BookService و اینترفیس IBookRepository از این پست دریافت کنید.
حالا با استفاده از NuGet باید ServiceLocator رو برای Ninject دریافت کنید. برای این کار در Package Manager Console دستور زیر رو وارد کنید.
PM> Install-Package CommonServiceLocator.NinjectAdapter
بعد از دانلود و نصب Referenceهای زیر به پروژه اضافه می‌شوند.
  • Ninject
  • NinjectAdapter
  • Microsoft.Practices.ServiceLocation 

اگر دقت کنید برای ایجاد ServiceLocator دارم از ServiceLocator؛Enterprise Library استفاده می‌کنم. ولی برای این کار به جای استفاده UnityServiceLocator باید از NinjectServiceLocator استفاده کنم. 

ابتدا

برای پیاده سازی مثال قبل در کلاس Program  کد‌های زیر رو وارد کنید.

using System;
using Ninject;
using NinjectAdapter;
using Microsoft.Practices.ServiceLocation;

namespace ServiceLocatorPattern
{
    class Program
    {
        static void Main( string[] args )
        {
            IKernel kernel = new StandardKernel();

            kernel.Bind<IBookRepository>().To<BookRepository>();

            ServiceLocator.SetLocatorProvider( () => new NinjectServiceLocator( kernel ) );

            BookService service = new BookService();

            service.PrintAllBooks();

            Console.ReadLine();
        }
    }
}
همان طور که می‌بینید روال انجام کار دقیقا مثل قبل هست فقط Syntax کمی متفاوت شده. برای مثال به جای استفاده از IUnityContainer از IKernel استفاده کردم و به جای دستور RegisterType از دستور Bind استفاده شده. دز نهایت هم ServiceLocator به یک NinjectServiceLocator ای که IKernel  رو دریافت کرده ست شد.
به تصویر زیر دقت کنید.

همان طور که می‌بینید در هر جای پروژه که نیاز به یک Instance از یک کلاس داشته باشید می‌تونید با استفاده از ServiceLocator این کار خیلی راحت انجام بدید.

بعد از اجرای پروژه  خروجی دقیقا مانند مثال قبل خواهد بود.

 
اشتراک‌ها
ILSpy 7.0 منتشر شد

New Language Features

  • C# 9.0: record classes
  • C# 9.0: with expressions
  • C# 9.0: primary constructors
  • Support for .NET 5 custom calling conventions
  • Improved support for Unsafe-intrinsics

UI Improvements

  • Dark mode (@tom-englert in #2347)
  • .NET bundles and Nuget packages are now directly embedded in the tree view
  • Search enabled in NuGet packages
  • Added setting highlight the current line in the code view (see #2224, by @DickvdBrink)
  • Simple UI language switching support 
ILSpy 7.0 منتشر شد
اشتراک‌ها
انتقال WebAssembly به سرور یا WASI

Bringing WebAssembly to the .NET Mainstream - Steve Sanderson, Microsoft

Many developers still consider WebAssembly to be a leading-edge, niche technology tied to low-level systems programming languages. However, C# and .NET (open-source, cross-platform technologies used by nearly one-third of all professional developers [1]) have run on WebAssembly since 2017. Blazor WebAssembly brought .NET into the browser on open standards, and is now one of the fastest-growing parts of .NET across enterprises, startups, and hobbyists. Next, with WASI we could let you run .NET in even more places, introducing cloud-native tools and techniques to a wider segment of the global developer community. This is a technical talk showing how we bring .NET to WebAssembly. Steve will demonstrate how it runs both interpreted and AOT-compiled, how an IDE debugger can attach, performance tradeoffs, and how a move from Emscripten to WASI SDK lets it run in Wasmtime/Wasmer or higher-level runtimes like wasmCloud. Secondly, you'll hear lessons learned from Blazor as an open-source project - challenges and misconceptions faced bringing WebAssembly beyond early adopters. [1] StackOverflow survey 2021 

انتقال WebAssembly به سرور یا WASI
اشتراک‌ها
بهبود کدهای فعلی با Domain-Driven Refactoring

Domain-Driven Refactoring - Jimmy Bogard - NDC London 2022

Books, workshops, storming and more, all build up an idealized domain model. All describe great techniques for domain-driven greenfield applications. But what about the code we have? How can we take what's already built, and move it towards a better, more cohesive design?
In this session, we'll look at anemic, procedural, boring code and examine code smells that can point us in the right direction. We'll also look at standard design patterns for more complex behaviors and models, and how to recognize when (and when not) to apply them. Finally, we'll cover how to safely apply refactoring techniques to achieve our domain-driven model nirvana. 

بهبود کدهای فعلی با Domain-Driven Refactoring
اشتراک‌ها
سری eShopSupport
eShopSupport Series

Starting next week, I will be digging into the eShopSupport codebase and blogging about it. Since it isn’t a RAG application - I don’t think it fits into the RAG Demo Series so I am going to be creating a new blog series focusing on this one codebase.
I have been waiting for the eShopSupport repo to be made public ever since I watched Steve’s NDC talk so I am really looking forward to this! Stay tuned.

Blogs in this series (to be updated as they get published):

DataGenerator Project
DataIngestor Project
Evaluator Project
Aspire Projects (AppHost and ServiceDefaults)
… more coming soon.

سری eShopSupport
اشتراک‌ها
ارائه‌ی کتابخانه‌ی SQLite به صورت یک اسمبلی خالص دات نتی

Preview: The SQLite Llibrary as a .NET assembly
The latest pre-release of SQLitePCLRaw contains a new bundle package called SQLitePCLRaw.bundle_cil. This package is like SQLitePCLRaw's other "bundle" packages except that it involves no P/Invoke and no platform-specific shared libraries. Instead, bundle_cil provides the SQLite library as a pure .NET assembly which was compiled by Llama. 

ارائه‌ی کتابخانه‌ی SQLite به صورت یک اسمبلی خالص دات نتی