GitHub Issues
The GitHub Issues integration allows you to search and reference your issues from the commit message box in VS, in response to this suggestion ticket. You can reference an issue or a pull request by typing # or clicking on the # button in the lower right side of the commit message text box. If you weren't already authenticated to access related issues, you will now be prompted to sign in to take advantage of this feature.
Line Unstaging
To continue improving our line-staging (aka interactive staging) feature, we've added unstage. You can now use the tool tip option to unstage changes, line by line, as requested here Unstage individual lines and hunks in a file - 4 votes
Arm64
We continue to build native support for Arm64 on Windows 11 for the most popular developer scenarios. We now support the .NET Multi-platform App UI (MAUI) workload on Arm64 Visual Studio.
C++
- Available as a preview feature, you can now view Unreal Engine logs without leaving VS. To see the logs from the Unreal Engine Editor, click View > Other Windows > UE Log. To filter your logs, click on the "Categories" or "Verbosity" dropdowns. Since this is an experimental feature, feedback is greatly appreciated.
- You can now import STM32CubeIDE projects for embedded development within Visual Studio with File > Open > Import STM32CubeIDE project. This generates a CMake project with device flashing and debugging settings for STLink. You must have the STM32CubeIDE installed with the board support package for your device. More details available here.
- You can use the new CMake Debugger to debug your CMake scripts at build time. You can set breakpoints based on filenames, line numbers, and when CMake errors are triggered. Additionally, you can view call stacks of filenames and watch defined variables. Currently, this only works with bundled CMake, and projects targeting WSL or remote machines are not supported yet. We are actively working to add more support to the CMake debugger, and feedback is greatly appreciated.
الگوی Matching
match expr with | pat1 -> result1 | pat2 -> result2 | pat3 when expr2 -> result3 | _ -> defaultResult
let booleanToString x = match x with false -> "False" | _ -> "True"
let stringToBoolean x = match x with | "True" | "true" -> true | "False" | "false" -> false | _ -> failwith "unexpected input"
printfn "(booleanToString true) = %s"
(booleanToString true)
printfn "(booleanToString false) = %s"
(booleanToString false)
printfn "(stringToBoolean \"True\") = %b"
(stringToBoolean "True")
printfn "(stringToBoolean \"false\") = %b"
(stringToBoolean "false")
printfn "(stringToBoolean \"Hello\") = %b"
(stringToBoolean "Hello")
(booleanToString true) = True
(booleanToString false) = False
(stringToBoolean "True") = true
(stringToBoolean "false") = false
Microsoft.FSharp.Core.FailureException: unexpected input
at FSI_0005.stringToBoolean(String x)
at <StartupCode$FSI_0005>.$FSI_0005.main@()
let myOr b1 b2 = match b1, b2 with | true, _ -> true //b1 true , b2 true or false | _, true -> true // b1 true or false , b2 true | _ -> false
printfn "(myOr true false) = %b" (myOr true false) printfn "(myOr false false) = %b" (myOr false false)
(myOr true false) = true (myOr false false) = false
در الگوی Matching اگر در بررسی ورودی الگو با یک مقدار نیاز شما را برطرف نمیکند استفاده از فیلترها و شروط مختلف هم مجاز است. برای مثال
let sign = function | 0 -> 0 | x when x < 0 -> -1 | x when x > 0 -> 1
عبارت if … then … else
استفاده از if در #F کاملا مشابه به استفاده از if در #C است و نیاز به توضیح ندارد. تنها تفاوت در else if است که در #F به صورت elif نوشته میشود.
ساختار کلی
if expr then expr elif expr then expr elif expr then expr ... else expr
let result = match System.DateTime.Now.Second % 2 = 0 with | true -> "heads" | false -> "tails"
let result = if System.DateTime.Now.Second % 2 = 0 then box "heads" else box false printfn "%A" result
Based on the above observations, we can conclude that React will be the best framework to learn in 2021, followed by Vue. But there is a high chance of Angular defending second place since it has been there for a longer period of time than Vue, and surely 2021 is not the end of that. So if you are an Angular developer, I suggest you learn React in the upcoming days.
EF Code First #7
- جزئیات بیشتر از زبان طراحان EF:
Deleting orphans with Entity Framework
+ طراحی پیش فرض است؛ مطابق مستندات MSDN:
If a foreign key on the dependent entity is nullable, Code First does not set cascade delete on the relationship, and when the principal is deleted the foreign key will be set to null.
کتابخانه ngx-page-scroll
Animated scrolling functionality for angular written in pure typescript with no additional dependencies Demo
- easy-to-use directive: scroll to an element referenced in the href-attribute (
href="#mytarget
) just by addingpageScroll
directive - service usage: trigger scroll animations from your component or when server responds
- customizable: adjust duration, offset or whether scrolling stops if the user interrupts (read more)
- use custom easing functions to calculate the scroll position over time
- works across routes (scrolls to target element as soon as the routing has finished) and in both directions (horizontal/vertical)
npm install ngx-page-scroll
Redis 6.0.0 GA منتشر شد
The next major release of the popular data structure server is here. Redis is at the heart of so many data systems nowadays that any major release is big news but 6.0 packs in a lot of new bits and pieces that make it more robust and capable of modern workloads, including:
- Access Control Lists (ACL) for limiting what certain clients can do.
- Diskless replication on replicas.
- Threaded I/O (but Redis itself remains primarily single threaded).
- SSL/TLS support.
- A new client-server protocol, RESP3.
ASP.NET MVC #18
[HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult LogOn(User user, string returnUrl) { if (this.ModelState.IsValid) { if (_userService.IsValid(user)) { int userID = _userService.GetUser(u => u.Username == user.Username && u.Password == user.Password).Id; FormsAuthentication.SetAuthCookie(userID.ToString(CultureInfo.InvariantCulture), user.RememberMe); if (shouldRedirect(returnUrl)) { return Redirect(returnUrl); } FormsAuthentication.RedirectFromLoginPage(userID.ToString(CultureInfo.InvariantCulture), user.RememberMe); } } this.ModelState.AddModelError("", "The user name or password provided is incorrect."); ViewBag.Error = "Login faild! Make sure you have entered the right user name and password!"; return View(user); }
کتابخانه toastee
Toastee is a light (4kb unminified) jQuery plugin for showing toast style messages. No CSS required. Demo