اشتراک‌ها
انتقال 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
اشتراک‌ها
مجموعه‌ای از بانک‌های اطلاعاتی نمونه
Collection of Sample Databases

In this post, I've compiled a comprehensive collection of sample databases, conveniently categorized by provider, to make it easier for you to find the right dataset for your needs. Whether you're looking for structured data for prototyping, experimenting with new metrics, or evaluating product performance, this collection offers a variety of real-world examples.
مجموعه‌ای از بانک‌های اطلاعاتی نمونه
پاسخ به پرسش‌ها
آیا امکان استفاده از Extension Method در زمان Select وجود دارد؟

البته یک نمونه در اینترنت پیدا کردم (البته پاسخ Copilot بوده) که متد را بصورت Generic تعریف کرده بود که برای انجام Dynamic Select روش زیر را بکاربرده بود:

IQueryable<TResult> results = query.SelectMany(x => selectProperties.Select(prop => prop.Compile()(x)));

تا اینجا هیچ مشکلی وجود ندارد ولی به محض آنکه در خط بعدی متد ToList اجرا میشه با پیغام خطا مواجه میشم:

An exception was thrown while attempting to evaluate a LINQ query parameter expression. See the inner exception for more information. To show additional information call 'DbContextOptionsBuilder.EnableSensitiveDataLogging'.

کد کامل Copilot:

public async Task<List<LineJoint2>> GetAsync2(
    Expression<Func<LineJoint, bool>> filter,
    List<Expression<Func<LineJoint, object>>> includes,
    List<Func<IIncludableQueryable<LineJoint, object>, IIncludableQueryable<LineJoint, object>>> thenIncludes,
    Expression<Func<IQueryable<LineJoint>, IOrderedQueryable<LineJoint>>> orderBy,
    int pageSize,
    int pageNumber,
    bool trackChanges = true,
    CancellationToken cancellationToken = default)
{
    var query = context.LineJoints.AsQueryable();

    // Apply filter
    if (filter != null)
        query = query.Where(filter);

    // Include related entities
    foreach (var include in includes)
        query = query.Include(include);

    // Apply thenIncludes
    foreach (var thenInclude in thenIncludes)
        query = thenInclude(query);

    // Project properties dynamically
    var projectedQuery = query.Select(x => new LineJoint2
    {
        Id = x.Id,
        JointNo = x.JointNo
        // Add other properties from LineJoint as needed
    });

    // Apply ordering
    if (orderBy != null)
        projectedQuery = orderBy.Compile()(projectedQuery);

    // Apply pagination
    var pagedQuery = projectedQuery.Skip((pageNumber - 1) * pageSize).Take(pageSize);

    // Execute the query
    return await (trackChanges ? pagedQuery : pagedQuery.AsNoTracking()).ToListAsync(cancellationToken);
}
نظرات مطالب
آپلود همزمان چندین فایل در Asp.Net Web Forms
اگر قرار باشه همین کار و با fileupload خود html انجام بدیم، موقع ذخیره کردن چی باید بنویسیم؟
چون وقتی می‌نویسیم btnFileUpload.PostedFiles خطا می‌گیره
System.Web.UI.HtmlControls.HtmlInputFile' does not contain a definition for 'PostedFiles' and no extension method 'PostedFiles' accepting a first argument of type 'System.Web.UI.HtmlControls.HtmlInputFile' could be found (are you missing a using directive or an assembly reference?)
نظرات مطالب
T4MVC : یکی از الزامات مدیریت پروژه‌های ASP.NET MVC
من در پروژم Controller ها رو در یک لایه و View‌ها را در لایه‌ی دیگری دارم. از T4MVC هم در لایه‌ی Controller استفاده کردم. اما بعد از زدن Run Custom Tool مسیرهایی که منتهی به یک view میشه ساخته نمیشه و Error میده! (آنهایی که RedirectToAction هستند به درستی ساخته می‌شه)

VDoc.Web.Controllers.TopicController.ViewsClass' does not contain a definition for '_Edit' and no extension method '_Edit' accepting a first argument of type 'VDoc.Web.Controllers.TopicController.ViewsClass' could be found (are you missing a using directive or an assembly reference?)

آیا برای استفاده از T4 در لایه‌های مختلف باید کار خاصی انجام بدم؟
نظرات مطالب
مروری بر قابلیت جدید ASP.NET FriendlyUrls
سلام؛ من کتابخانه رو به پروژه اضافه کردم. اما برای فعال سازیش به مشکل برخوردم. EnableFriendlyUrls رو نمیشناسه و خطا میده
 System.Web.Routing.RouteCollection' does not contain a definition for 'EnableFriendlyUrls' 
and no extension method 'EnableFriendlyUrls' accepting a first argument of type 
'System.Web.Routing.RouteCollection' could be found (are you missing a using directive or an assembly reference?)
استفاده هم زمان این روش با url routing که مشکلی به وجود نمیاره؟
اشتراک‌ها
نگاهی به بهبودهای کارآیی در NET Core. و ASP.NET Core 3.0

What’s new for performance in .NET Core and ASP.NET Core 3.0 – Ben Adams
One of the biggest advantages of using .NET Core (besides cross-platform support) is the drastic improvements in performance. Because the .NET Core team was able to make minor breaking changes in the runtime and Base Class Library (BCL), lots of stuff was implemented much more efficiently. In this session Ben will dive into the performance improvements in .NET Core in the 3.0 release: runtime changes, JIT changes, intrinsics and a deep dive into some of the improvements making it the best release yet!

نگاهی به بهبودهای کارآیی در NET Core. و ASP.NET Core 3.0
اشتراک‌ها
مثال هایی از نحوه نوشتن PBI
News  
  • As a site visitor, I can read current news on the home page.
  • As a site visitor, I can access old news that is no longer on the home page.
  • As a site visitor, I can email news items to the editor. (Note: this could just be an email link to
  • the editor.)
  • As a site a site editor, I can set the following dates on a news item: Start Publishing Date, Old
  • News Date, Stop Publishing Date. These dates refer to the date an item becomes visible on the site (perhaps next Monday), the date it stops appearing on the home page, and the date it is removed from the site (which may be never).
  • As a site member, I can subscribe to an RSS feed of news (and events? Or are they separate?).
  • As a site editor, I can assign priority numbers to news items. Items are displayed on the front page based on priority.  
مثال هایی از نحوه نوشتن PBI
اشتراک‌ها
روش محدود کردن اکشن متدهای ASP.NET Core به درخواست‌های صرفا Ajax ای
Allow only Ajax requests for an action in ASP.NET Core

ASP.NET Core offers attributes such as [HttpGet] and [HttpPost] that allow you to restrict the HTTP verbs used to invoke an action. You can also use HttpRequest object's Method property to detect the HTTP verb behind the current request. However, at times you need to know whether a request is an Ajax request or not. You may also need to restrict an action only to Ajax calls. Although thee is no inbuilt way to accomplish this task, you can easily implement such a feature in your application. This article discusses how.
 
روش محدود کردن اکشن متدهای ASP.NET Core به درخواست‌های صرفا Ajax ای