Skip to content

Instantly share code, notes, and snippets.

View tetsuzin's full-sized avatar

tetsuzin tetsuzin

View GitHub Profile
@tetsuzin
tetsuzin / Program.cs
Created January 19, 2020 16:18
HttpClientとWebRequestのポート使い方検証
class Program
{
static async Task Main(string[] args)
{
var cts = new CancellationTokenSource();
var client = new HttpClient();
var url = "https://localhost:44399/weatherforecast";
Task.WhenAll(
@tetsuzin
tetsuzin / Program.cs
Created January 15, 2020 05:22
11行目で死ぬコード
namespace ConsoleApp1
{
public class Hoge
{
public static int Int;
public static Fuga Fuga;
static Hoge()
{
Int = 10;
@tetsuzin
tetsuzin / gist:5132619
Last active December 14, 2015 18:49
F#でのインターフェイスの型拡張の書き方。 type ~ with ではなく、 type ~ = であることに注意
//C#でインターフェイスを作成
namespace CSLibBase
{
public interface ISample
{
int SampleMethod(int x);
}
}
@tetsuzin
tetsuzin / gist:1675139
Created January 25, 2012 06:54
F#側でジェネリッククラスの型拡張をする場合の注意点
public interface IRepository<TEntity> where TEntity : class
{
TEntity Find(params object[] keyValues);
}
public abstract class Repository<TContext, TEntity> : IRepository<TEntity>
where TContext : DbContext, new()
where TEntity : class
{
protected TContext _context;