اشتراک‌ها
امکانات جدید صفحات Razor

Razor Pages is a new feature of ASP.NET Core MVC that makes coding page-focused scenarios easier and more productive.

Razor Pages requires ASP.NET Core 2.0.0 or later. Tooling support for Razor Pages ships in Visual Studio 2017 Update 3 or later. 

امکانات جدید صفحات Razor
اشتراک‌ها
ساخت چت روم با web socket در asp.net core

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. 

ساخت چت روم با web socket در asp.net core
نظرات مطالب
ارتقاء به ASP.NET Core 2.0 - معرفی بسته‌ی Microsoft.AspNetCore.All
اگر هنگام اجرای برنامه در نگارش  ASP.Net Core 2.2 با مشکل  HTTP Error 500.30 - ANCM In-Process Start Failure   

مواجه شدید تنظیمات فایل 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 در دسترس نیست . 
نظرات مطالب
از سرگیری مجدد، لغو درخواست و سعی مجدد دریافت فایل‌های حجیم توسط HttpClient
یک نکته‌ی تکمیلی: پشتیبانی توکار ASP.NET Core 2.0 از Range headers

فرض کنید برای آزمایش قسمت «از سرگیری مجدد» دریافت یک فایل حجیم مطلب جاری، یک چنین کدی را در یک برنامه‌ی ASP.NET Core 2.0 تهیه کرده‌اید:
    public class HomeController : Controller
    {
        public IActionResult GetFile()
        {
            return PhysicalFile(@"C:\path\file.pdf", "application/pdf");
        }
در مورد PhysicalFile در مطلب «تغییرات متدهای بازگشت فایل‌ها به سمت کلاینت در ASP.NET Core» بیشتر بحث شده‌است.
اجرای این کد به همراه هدر مخصوص «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. 

مروری بر ASP.NET Core View Component
اشتراک‌ها
Visual Studio 2017 15.5.7 منتشر شد

Issues Fixed in this Release

Projects targeting .NET Core 2.1 or newer are not supported by Visual Studio 2017 version 15.5 .
Fixed issue where installation of the SDK for .NET Core 2.1 or newer would cause the option to create ASP.NET Core 2.0 Web applications to disappear .
Visual Studio 2017 15.5.7 منتشر شد
اشتراک‌ها
استفاده از بانک اطلاعاتی in-memory جهت نوشتن آزمون واحد
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. 
استفاده از بانک اطلاعاتی in-memory جهت نوشتن آزمون واحد