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
;WITH TableSizes AS ( | |
SELECT | |
s.Name AS SchemaName, | |
t.NAME AS TableName, | |
p.rows AS RowCounts, | |
CAST(SUM(a.total_pages) * 8 / 1024.0 AS DECIMAL(10, 2)) AS TotalSpaceMB | |
FROM | |
sys.tables t | |
INNER JOIN | |
sys.indexes i ON t.OBJECT_ID = i.object_id |
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
namespace Microsoft.eShopWeb.Features.Orders; | |
[Route("order/my-orders")] | |
public class GetMyOrdersController(CatalogContext db) : Controller | |
{ | |
[HttpGet] | |
public async Task<IActionResult> MyOrders() | |
{ | |
var userName = User.Identity.Name; | |
var orders = await db.Orders |
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 BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Environments; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Reports; | |
namespace Benchmarks | |
{ | |
[Config(typeof(Config))] |
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 BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Environments; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Reports; | |
using BenchmarkDotNet.Running; | |
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); |
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 BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Environments; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Reports; | |
[Config(typeof(Config))] | |
[HideColumns(Column.Job, Column.RatioSD, Column.AllocRatio)] | |
[MemoryDiagnoser] |
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 Microsoft.AspNetCore.Diagnostics; | |
namespace Samples; | |
public class GlobalExceptionHandler(ILogger<GlobalExceptionHandler> logger) : IExceptionHandler | |
{ | |
public ValueTask<bool> TryHandleAsync( | |
HttpContext httpContext, | |
Exception exception, | |
CancellationToken cancellationToken) |
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 Microsoft.AspNetCore.Diagnostics; | |
using Microsoft.AspNetCore.Mvc; | |
using System.Net; | |
namespace Samples; | |
public class GlobalExceptionHandler(ILogger<GlobalExceptionHandler> logger) : IExceptionHandler | |
{ | |
public async ValueTask<bool> TryHandleAsync( | |
HttpContext httpContext, |
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; | |
using System.Runtime.InteropServices; | |
public class C { | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(RuntimeInformation.OSDescription); | |
Console.WriteLine(RuntimeInformation.ProcessArchitecture.ToString()); | |
Console.WriteLine(RuntimeInformation.FrameworkDescription); | |
} |
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 Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Logging; | |
using System.Text; | |
using System.Text.Json; | |
namespace Samples; | |
public class ChatGPTAPIExample(ILogger<ChatGPTAPIExample> logger, IConfiguration configuration) | |
{ | |
private string Prompt = "Please explain the following code :"; |
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
{ | |
repository(owner: "dotnet", name: "runtime") { | |
pullRequests(states: MERGED, first: 100, orderBy: {field: CREATED_AT, direction: DESC}) { | |
edges { | |
node { | |
title | |
url | |
number | |
mergedAt | |
reviewDecision |