| name | migrating-to-mstest-sdk | ||||
|---|---|---|---|---|---|
| description | Migrates .NET test projects from the traditional MSTest setup (Microsoft.NET.Test.Sdk + MSTest.TestAdapter + MSTest.TestFramework) to MSTest.Sdk, the modern project SDK approach that bundles all testing infrastructure. Use when upgrading test projects, modernizing MSTest configuration, adopting MSTest Platform (MTP), or when users ask to "switch to MSTest.Sdk", "use latest MSTest", "migrate to MTP", or "update test project to MSTest SDK". Also relevant during .NET version upgrades when test projects are being modernized. | ||||
| metadata |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Diagnostics.CodeAnalysis; | |
| using Microsoft.EntityFrameworkCore.ChangeTracking; | |
| namespace Common; | |
| public static class EntityEntryExtensions | |
| { | |
| extension<TEntity>(EntityEntry<TEntity> entityEntry) where TEntity : class | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static Dictionary<string, string> GetDatabaseTables(DbContext db) | |
| { | |
| Dictionary<string, string> tablesDictionary = []; | |
| var connection = db.Database.GetDbConnection(); | |
| using var command = connection.CreateCommand(); | |
| command.CommandText = "SELECT name, sql from sqlite_schema where type='table';"; | |
| using var reader = command.ExecuteReader(); | |
| while (reader.Read()) | |
| { | |
| var entityName = reader.GetString(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <#PSScriptInfo | |
| .VERSION 1.0.0 | |
| .AUTHOR Peter Ritchie | |
| .COMPANYNAME | |
| .COPYRIGHT | |
| .TAGS Visual Studio, dotnet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <#PSScriptInfo | |
| .VERSION 1.0.0 | |
| .AUTHOR Peter Ritchie | |
| .COMPANYNAME | |
| .COPYRIGHT | |
| .TAGS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Gets the build validation policies for repositories associated with solution files in the specified path. | |
| .DESCRIPTION | |
| Retrieves and lists the build validation branch policies for repositories that correspond to solution files found in the specified path. | |
| .PARAMETER Path | |
| Specifies the path to search for solution files. | |
| #> | |
| [CmdletBinding()] | |
| param( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Adds an XML element to a specified XPath in an XML file. | |
| .DESCRIPTION | |
| This script reads an XML file, adds a specified XML element to a given XPath within that file. | |
| It can optionally overwrite existing elements if the -Force parameter is specified. | |
| .PARAMETER Path | |
| The path to the XML file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Adds a JSON object to a specified path within a JSON file. | |
| .DESCRIPTION | |
| This script reads a JSON file, adds a specified JSON object to a given path within that file, and outputs the modified JSON. | |
| .PARAMETER Path | |
| The path to the JSON file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using Microsoft.FeatureManagement; | |
| namespace Pri.ProductivityUtilities; | |
| public class FakeFeatureManager : IFeatureManager, IEnumerable<KeyValuePair<string, bool>> | |
| { | |
| Dictionary<string, bool> features = new(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| namespace Pri.ProductivityUtilities; | |
| /// <summary> | |
| /// Represents a collection of items that compares equality based on the values of its elements, | |
| /// rather than reference equality. This collection is read-only and ensures that two instances | |
| /// with the same content are considered equal. | |
| /// </summary> | |
| /// <typeparam name="T"> |
NewerOlder