اشتراکها
WebSocket is real-time communication protocol we can use to make UI in browser to send and receive messages from server over real-time communication channel. WebSocket is also supported by ASP.NET Core. This blog post demonstrates how to build simple browser based chat room on ASP.NET Core and WebSocket.
اگر هنگام اجرای برنامه در نگارش ASP.Net Core 2.2 با مشکل HTTP Error 500.30 - ANCM In-Process Start Failure
(ASP.NET Core Module (ANCM ارائه شده در نگارش 2.2 در دسترس نیست .
مواجه شدید تنظیمات فایل csproj را به OutOfProcess تغییر دهید .
Change this section ... <PropertyGroup> <TargetFramework>netcoreapp2.2</TargetFramework> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> </PropertyGroup> to the following ... <PropertyGroup> <TargetFramework>netcoreapp2.2</TargetFramework> <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> <AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName> </PropertyGroup>
(ASP.NET Core Module (ANCM ارائه شده در نگارش 2.2 در دسترس نیست .
اشتراکها
مقایسه کارآیی NET Core. با NET Full.
اشتراکها
برنامه نویسی هم روند در .net core
یک نکتهی تکمیلی: پشتیبانی توکار ASP.NET Core 2.0 از Range headers
فرض کنید برای آزمایش قسمت «از سرگیری مجدد» دریافت یک فایل حجیم مطلب جاری، یک چنین کدی را در یک برنامهی ASP.NET Core 2.0 تهیه کردهاید:
در مورد PhysicalFile در مطلب «تغییرات متدهای بازگشت فایلها به سمت کلاینت در ASP.NET Core» بیشتر بحث شدهاست.
اجرای این کد به همراه هدر مخصوص «Accept-Ranges: bytes » که در مطلب جاری در مورد آن بحث شد نیز هست:
یعنی دریافت فایلها در ASP.NET Core 2.0 به صورت توکار از ویژگی «از سرگیری مجدد» پشتیبانی میکند. قابلیتی که در نگارشهای پیشین ASP.NET (تمام نگارشهای آن)، به صورت پیشفرض و توکار وجود نداشت و برای پیاده سازی آن میبایستی مقدار زیادی کد نوشته میشد.
فرض کنید برای آزمایش قسمت «از سرگیری مجدد» دریافت یک فایل حجیم مطلب جاری، یک چنین کدی را در یک برنامهی ASP.NET Core 2.0 تهیه کردهاید:
public class HomeController : Controller { public IActionResult GetFile() { return PhysicalFile(@"C:\path\file.pdf", "application/pdf"); }
اجرای این کد به همراه هدر مخصوص «Accept-Ranges: bytes » که در مطلب جاری در مورد آن بحث شد نیز هست:
یعنی دریافت فایلها در ASP.NET Core 2.0 به صورت توکار از ویژگی «از سرگیری مجدد» پشتیبانی میکند. قابلیتی که در نگارشهای پیشین ASP.NET (تمام نگارشهای آن)، به صورت پیشفرض و توکار وجود نداشت و برای پیاده سازی آن میبایستی مقدار زیادی کد نوشته میشد.
در اینجا return File، FileStreamResult و VirtualFileResult نیز از ویژگی partial range requests پشتیبانی میکنند. همچنین حتی اگر از static files middleware آن نیز استفاده کنید، یک چنین قابلیتی را پیاده سازی کردهاست.
به علاوه تمام متدهای بازگشت فایل، پارامتر enableRangeProcessing را نیز به همراه دارند:
var result = new FileStreamResult(readStream, contentType) { LastModified = lastModified, EntityTag = entityTag, EnableRangeProcessing = true, }; return PhysicalFile(path, "text/plain", "downloadName.txt", lastModified, entityTag, true); return File(data, "text/plain", "downloadName.txt", lastModified: null, entityTag: entityTag, enableRangeProcessing: true);
اشتراکها
مروری بر ASP.NET Core View Component
Partial Views and Child Actions are one the most used features of ASP.NET MVC. Partial Views provides us a way to create a reusable component that can be used in multiple Views. There are Actions which can be marked as Child Actions and these cannot be invoked via URL but inside views or partial views. Child Actions are no more available with ASP.NET Core. View Components are new way to implement this feature in ASP.NET Core.
اشتراکها
Visual Studio 2017 15.5.7 منتشر شد
ASP.NET Core applications can be tested with different testing
frameworks and Entity Framework Core makes testing specially easy by
removing different technical problems from our way by using in-memory
data provider. This blog posts shows how to unit test controllers that
use data from Entity Framework Core.