SQL Server® 2014 Service Pack 1 منتشر شد
حالا با استفاده از NuGet باید ServiceLocator رو برای Ninject دریافت کنید. برای این کار در Package Manager Console دستور زیر رو وارد کنید.
PM> Install-Package CommonServiceLocator.NinjectAdapter
- 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(); } } }
به تصویر زیر دقت کنید.
همان طور که میبینید در هر جای پروژه که نیاز به یک 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
انتقال 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
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.
سری eShopSupport
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.
3.Visual Studio 2019 RC منتشر شد
- Modal progress dialog stays open permanently even when IDE is responsive ('Preparing Solution', 'Creating Project', Edit and Continue, etc).
- PackageId:OpenJDKV1;PackageAction:Uninstall;ReturnCode:0;.
- .sql files are empty.
- Properties Window in Forms Designer shows vertical scrollbar without drag handle with automatic scaling on 4K display in Visual Studio 2019 RC.
- VSIXInstaller.exe crashes randomly when installing multiple extensions sequentially in Visual Studio 2019 RC.1.
- MSBuild failure when executing multi-line Exec commands.
- You can now use Time Travel Debugging with the snapshot debugger on ASP.NET Apps running on an Azure VM. Please note that this feature may not work in all Azure regions at release.