This file contains 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.ComponentModel.DataAnnotations.Schema; | |
using System.Reflection; | |
using BenchmarkDotNet.Attributes; | |
using Dapper; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Metadata.Builders; | |
using Microsoft.EntityFrameworkCore.Metadata.Conventions; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace Benchmarks; |
This file contains 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.Buffers; | |
using System.Dynamic; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using BenchmarkDotNet.Attributes; | |
namespace Benchmarks; | |
/* record | |
| Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated | |
This file contains 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.Collections.Generic; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Http.Headers; | |
using System.Reflection; | |
using System.Security.Authentication; | |
using System.Security.Claims; | |
using System.Security.Cryptography; |
This file contains 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 計算單位 = uint; | |
using 驗證單位 = ulong; // 需要比計算單位大 | |
Console.WriteLine($"計算單位: {typeof(計算單位).Name} (Max: {計算單位.MaxValue}), 驗證單位: {typeof(驗證單位).Name}"); | |
for (計算單位 乘數 = 2; 乘數 <= (計算單位.MaxValue / 2); 乘數 += (計算單位)Math.Pow(10, Math.Floor(Math.Log10(乘數)))) | |
{ | |
for (計算單位 被乘數 = 1; 被乘數 < 計算單位.MaxValue; 被乘數++) | |
{ | |
var total = (計算單位)(被乘數 * 乘數); |
This file contains 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
#define 有提供存取成員的公開屬性 | |
using System; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using BenchmarkDotNet.Attributes; | |
using TestDatas; | |
/* | |
// * Summary * |
This file contains 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.IO; | |
using System.Net.WebSockets; | |
using System.Text; | |
using System.Text.Json; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.DependencyInjection; |
This file contains 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; | |
var json = """ | |
{ | |
"IntVal": 3, | |
"Inner": | |
{ | |
"FloatVal": 9.8, | |
"Message": "Test" | |
}, |
This file contains 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.Threading; | |
using System.Threading.Tasks; | |
using UnityEngine; | |
public sealed class Main : MonoBehaviour | |
{ | |
static int ThreadId => Environment.CurrentManagedThreadId; | |
GameObject _object; |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using NUnit.Framework; | |
using UnityEditor; | |
public sealed class EnumTest | |
{ | |
[Test] | |
[TestCase("iOS", true, "iOS")] // iOS 有效 |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using static System.Linq.Expressions.Expression; | |
public static class Comparer | |
{ | |
static readonly Dictionary<Type, Func<object, object, bool>> s_cache = new(); |
NewerOlder