Soft Delete؛ خوب یا بد؟
کتاب برنامه نویسی Blockchain با #C
Visual Studio 2017 15.7 منتشر شد
- We added support to change installation locations.
- You can Save All your pending changes before you start your update.
- The update dialog provides you even more details about your update during installation.
- C# 7.3 is included in Visual Studio version 15.7.
- We improved solution load time for C# and VB projects.
- We made numerous updates to F# and its tools, with a focus on performance.
- We reduced the time to enable IntelliSense for large .NET Core projects by 25%.
- We made Quick Info improvements and new .NET refactorings like convert
for
-to-foreach
and make private fieldsreadonly
. - We added the ability to publish ASP.NET Core applications to App Service Linux without containers.
- Live Unit Testing works with embedded pdbs and supports projects that use reference assemblies.
- The Test Explorer has more responsive icons during test runs.
- C++ developers can use CodeLens for unit testing.
- We added new rules enforcing items from the C++ Core Guidelines.
- Debugging large solutions with /Debug:fastlink PDBs is more robust.
- CMake integration supports CMake 3.11 and static analysis.
- Python projects support type hints in IntelliSense, and a Run MyPy command has been added to look for typing errors in your code.
- Conda environments are supported in Python projects.
- We added a next version of our Python debugger based on the popular open source pydevd debugger.
- TypeScript 2.8 is included in Visual Studio version 15.7.
- We improved Kestrel HTTPs support during debugging.
- We added support for JavaScript debugging with Microsoft Edge.
- The Debugger supports VSTS and GitHub Authentication for Source Link.
- IntelliTrace’s step-back debugging feature is supported for debugging .NET Core projects.
- We added IntelliTrace support for taking snapshots on exceptions.
- We removed the blocking modal dialog from branch checkouts in Git when a solution or project reload is not required.
- There is an option to choose between OpenSSL and SChannel in Git.
- You can create and associate Azure Key Vaults from within the Visual Studio IDE.
- Visual Studio Tools for Xamarin can automatically install missing Android API levels required by Xamarin.Android projects.
- The Xamarin.Forms XAML editor provides IntelliSense and quick fixes for conditional XAML.
- We added support for Azure, UWP, and additional project types in Visual Studio Build Tools.
- You can create build servers without installing all of Visual Studio.
- The Windows 10 April 2018 Update SDK - Build 17134 is the default required SDK for the Universal Windows Platform development workload.
- We added support for Visual State Management for all UWP apps and more.
- We enabled automatic updates for sideloaded APPX packages.
- You have new tools for migrating to NuGet PackageReference.
- We added support for NuGet package signatures.
- We added Service Fabric Tooling for the 6.2 Service Fabric release.
- We updated Entity Framework Tools to work with the EF 6.2 runtime and to improve reverse engineering of existing databases.
برای تولید چنین نموداری از میتوانیم Mermaid استفاده کنیم. یکی از انواع دیاگرامهایی را که پشتیبانی میکند، Gitgraph میباشد. دیاگرامها در Mermaid با کمک یک DSL ساخته میشوند. سینکس آن نیز خیلی ساده است؛ ابتدا نوع دیاگرامی را که میخواهیم ترسیم کنیم، تعیین میکنیم و سپس محتویات را براساس نوع دیاگرام، تعیین میکنیم. به عنوان مثال برای Gitgraph سینتکس آن به این صورت است:
gitGraph commit commit branch develop checkout develop commit commit checkout main merge develop commit commit
در ساختار فوق ابتدا دو کامیت بر روی برنچ اصلی (main) انجام شدهاست؛ سپس یک برنچ جدید را با نام develop، ایجاده کردهایم و بلافاصله به آن checkout کردهایم. در ادامه تعدادی کامیت را بر روی این برنچ انجام داده و در نهایت برنچ موردنظر را بر روی main، مرج کردهایم. در نهایت نیز دو کامیت دیگر را بر روی main ایجاد کردهایم. تعریف فوق، منجر به ساخت چنین نموداری خواهد شد:
از ادیتور آنلاین Mermaid نیز میتوانید برای تست سینکس استفاده کنید. در ادامه میخواهیم با کمک PowerShell، از روی یک پروژهی گیت، DSL موردنیاز برای ساخت دیاگرام را ایجاد کنیم. برای اینکار ابتدا توسط تابع زیر یک پروژهی گیت را با تعدادی فایل نمونه ایجاد خواهیم کرد:
Function New-RandomRepo { Function RandomFiles($branch = "main") { 1..3 | ForEach-Object { New-Item -ItemType File -Name "file_$($_).txt" Set-Content -Path "file_$($_).txt" -Value "This is file $($_) on branch $branch" git add . git commit -m "Commit $($_) on branch $branch" } } Set-Location ~/Desktop New-Item -ItemType Directory "random_git_repo" Set-Location "random_git_repo" git init -b main Write-Output "This is the main branch" | Set-Content -Path "main.txt" git add . git commit -m "Initial commit" 1..3 | ForEach-Object { git checkout -b "branch_$($_)" RandomFiles "branch_$($_)" git checkout main } }
در ادامه تابع New-GitRepoDiagram را برای تولید ساختار مورد نیاز نوشتهایم:
Function New-GitRepoDiagram { $commitIds = @() $branches = git branch | ForEach-Object { $default = $false $activeBranch = git symbolic-ref --short HEAD $currentBranch = ($_.Replace("* ", " ")).Trim() if ($currentBranch -eq $activeBranch) { $default = $true } @{ name = $currentBranch isMainBranch = $default } | ConvertTo-Json } | ConvertFrom-Json $defaultBranch = $branches | Where-Object { $_.isMainBranch -eq $true } | Select-Object -ExpandProperty name $mermaidFile = "%%{init: { 'gitGraph': {'mainBranchName': '$defaultBranch' } } }%%" + [Environment]::NewLine $mermaidFile += 'gitGraph' + [Environment]::NewLine foreach ($branch in ($branches | Sort-Object -Property isMainBranch -Descending)) { $name = $branch.name $notIncludeTheMainCommits = $name -ne $defaultBranch ? "--not $(git merge-base $defaultBranch $name)" : "" $notIncludeTheMainCommits $logs = git log --pretty=format:'{"commit": "%h", "author": "%an", "message": "%s"}' --reverse $name | ConvertFrom-Json if ($name -ne $defaultBranch) { $mermaidFile += ' branch "$name"'.Replace('$name', $name) + [Environment]::NewLine } foreach ($log in $logs) { $commit = $log.commit if ($commitIds -contains $commit) { continue } $commitToAdd = ' commit id: "$commit"'.Replace('$commit', $commit) + [Environment]::NewLine $mermaidFile += $commitToAdd $commitIds += $commit } if ($name -ne $defaultBranch) { $mermaidFile += ' checkout main' + [Environment]::NewLine } } Write-Host $mermaidFile }
توضیحات:
- در تابع فوق، ابتدا یک آرایهی خالی برای ذخیرهی کامیت آیدیها، اضافه شده؛ از این آرایه برای جلوگیری از اضافه شدن کامیت تکراری در هر برنچ استفاده شدهاست.
- سپس با کمک دستور git branch، لیست تمام برنچها، دریافت شدهاست (همانطور که در قسمت قبل بررسی شد +).
- برای هر برنچ، تابع تعیین میکند که آیا برنچ جاری است یا خیر. اینکار با کمک دستور git symbolic-ref انجام شدهاست.
- در ادامه متغیر mermaidFile$ برای ایجاد یک گراف جدید Git مقداردهی میشود. در اینجا نام برنچ اصلی برابر با نام برنچ پیشفرض، تنظیم میشود.
- سپس لیست کامیتهای هر برنچ را با کمک دستور git log (همان سینتکسی که در قسمتهای قبل بررسی شد +) استخراج میکنیم.
- و در نهایت به ازای هر کامیت، یک commit id تولید کردهایم.
با فراخوانی تابع فوق، اینچنین ساختاری برایمان تولید خواهد شد:
%%{init: { 'gitGraph': {'mainBranchName': 'main' } } }%% gitGraph commit id: "765100f" branch "branch_1" commit id: "c88c441" commit id: "44149d9" commit id: "a660fe3" checkout main branch "branch_2" commit id: "2dcb572" commit id: "b043ad1" commit id: "92cafc0" checkout main branch "branch_3" commit id: "559e381" commit id: "f72957f" commit id: "c066e72" checkout main
خروجی فوق دقیقاً دیاگرامی است که در ابتدای مطلب نشان داده شد:
افزونه تعویض قالبهای Bootstrap
دوره سه ساعته آموزش Blazor
00:00:00 Introduction
00:03:07 Blazor Project Structure
00:12:14 How Blazor Works
00:20:28 What is an Inventory Management System
00:23:47 Introduction to Clean Architecture
00:30:58 Null Reference Type in .NET 6
00:36:44 Write the View Inventories Use Case
00:45:16 Implement the View Inventories Use Case
00:59:27 Create a Plugin with Dependency Injection
01:08:45 Inject the Use Case in Razor Component
01:17:35 Dependency Injection in Blazor
01:28:08 Page Component - Create the Inventory List Page
01:34:34 SPA Components Best Practice
01:38:07 Databinding and EventCallback in Search Inventory Component
01:52:59 Component Parameters in Inventory List Component
02:03:52 Null Checks
02:06:07 Extract the Inventory List Item Component
02:09:45 Add Inventory Use Case
02:12:10 Implement Add Inventory Repository Methods
02:15:34 NavigationManager
02:17:56 EditForm and Data Validation
02:30:09 Edit Inventory Use Case
02:35:12 Implement Edit Inventory Repository methods
02:43:00 Receive Routing Parameters
02:50:09 Implement Edit Inventory Component
03:03:06 Why we are using Async everywhere