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
مجموعهای از بانکهای اطلاعاتی نمونه
البته یک نمونه در اینترنت پیدا کردم (البته پاسخ 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
چون وقتی مینویسیم 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?)
مروری بر قابلیت جدید ASP.NET FriendlyUrls
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?)
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!
مثال هایی از نحوه نوشتن PBI
- 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.
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.