ASP.NET Core 6 Preview 5 منتشر شد
Here’s what’s new in this preview release:
- .NET Hot Reload updates for
dotnet watch
- ASP.NET Core SPA templates updated to Angular 11 and React 17
- Use Razor syntax in SVG
foreignObject
elements - Specify null for
Action
andRenderFragment
component parameters - Reduced Blazor WebAssembly download size with runtime relinking
- Configurable buffer threshold before writing to disk in Json.NET output formatter
- Subcategories for better filtering of Kestrel logs
- Faster get and set for HTTP headers
- Configurable unconsumed incoming buffer size for IIS
ماشین حساب برای Sublime
using System.Collections.Generic; namespace TestRouting.Models { public class Issue { public int IssueId { set; get; } public int ProjectId { set; get; } public string Title { set; get; } public string Body { set; get; } } public static class IssuesDataSource { public static IList<Issue> CreateDataSource() { var results = new List<Issue>(); for (int i = 0; i < 100; i++) { results.Add(new Issue { IssueId = i, ProjectId = i, Body = "Test...", Title = "Title " + i }); } return results; } } }
using System.Linq; using System.Web.Mvc; using TestRouting.Models; namespace TestRouting.Controllers { public class HomeController : Controller { public ActionResult Index() { var issuesList = IssuesDataSource.CreateDataSource(); return View(issuesList); //show the list } public ActionResult Details(int issueId, int projectId) { var issue = IssuesDataSource.CreateDataSource() .Where(x => x.IssueId == issueId && x.ProjectId == projectId) .FirstOrDefault(); return View(issue); } } }
@model IEnumerable<TestRouting.Models.Issue> @{ ViewBag.Title = "Index"; } <h2> Issues</h2> <ul> @foreach (var item in Model) { <li> @Html.ActionLink(linkText: item.Title, actionName: "Details", controllerName: "Home", routeValues: new { issueId = item.IssueId, projectId = item.ProjectId }, htmlAttributes: null) </li> } </ul>
http://localhost:1036/Home/Details?issueId=0&projectId=0
برای مثال آنرا به نحو زیر نمایش داد:
http://localhost:1036/Home/Details/0/0
using System.Web.Mvc; using System.Web.Routing; namespace TestRouting { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "IssueDetails", url: "Details/{issueId}/{projectId}", //تطابق با یک چنین مسیرهایی defaults: new { controller = "Home", //کنترلری که این نوع مسیرها را پردازش خواهد کرد action = "Details", // اکشن متدی که نهایتا پارامترها را دریافت میکند issueId = UrlParameter.Optional, //این خواص نیاز است هم نام پارامترهای اکشن متد تعریف شوند projectId = UrlParameter.Optional } ); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } }
این route جدید با مسیرهایی مطابق پارامتر url آن تطابق خواهد یافت. پس از آن کوئری استرینگ متناظر با issueId را به پارامتر issueId اکشن متدی به نام Details و کنترلر Home ارسال خواهد کرد؛ به همین ترتیب در مورد projectId عمل خواهد شد.
ضمنا در url نهایی نمایش داده شده، دیگر اثری از کوئری استرینگها نبوده و برای نمونه در این حالت، اولین لینک نمایش داده شده شکل زیر را خواهد داشت:
http://localhost:1036/Home/Details/0/0
دوره WPF پیشرفته
01 - The Basics
02 - TreeViews and Value Converters
03 - View Model MVVM Basics
04 - Custom Window Chrome and Styles
05 - Creating Login Form Sign Up Screen
06 - Attached Properties
07 - Storyboard Animations
08 - Advanced View Models Real World
09 - User Controls Side Menu Content
10 - ItemsControl Chat List & Design Time Data
11 - Dependency Injection & Multiple Projects
12 - MVVM View Model Binding to Animations
13 - Complete Page Animation
14 - Create Chat Message Bubbles
15 - Adaptive Control Design with View Model Binding
16 - Chat Message Title Bar Menu
17 - Chat Message Input Box Control
18 - Styling Scrollbars Custom
19 - Creating Popup Menus
20 - Creating Vertical Popup Menu
21 - Custom Dialog System Message Box Popup
22 - Slide Up Settings Menu
23 - Settings Page UI
24 - Advanced Edit Text Control
25 - Advanced Cross-Control Syncing