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; | |
namespace ConsoleApp { | |
class Program { | |
static void Main( string[] args ) { | |
var items = new HashSet<int> { 0, 1, 2, 3, 4, }; | |
// otherが同じ要素を含んでいるかどうか |
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
/* | |
指定DBを指定フォルダにバックアップ | |
バックアップファイル名には日付の文字列が含まれる | |
*/ | |
declare @dbName sysname = N'DB名'; | |
declare @folder nvarchar( max ) = N'バックアップフォルダ(\で終わる必要あり)'; | |
declare @date datetime = getdate(); | |
declare @ymd char( 8 ) = convert( char( 8 ), @date, 112 ); -- yymmdd | |
declare @hms char( 6 ) = replace( convert( char( 8 ), @date, 108 ), ':', '' ); -- hh:mm:ss -> hhmmss |
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.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApp { | |
public static class EnumExtensions { | |
// enumに適用されている属性を取得 | |
public static IEnumerable<TAttribute> GetApplied<TAttribute>(this Enum value) where TAttribute : Attribute { |
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.Data; | |
using System.Data.SqlClient; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Dapper; | |
namespace ConsoleApp { |
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.Data.SqlClient; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Text; | |
namespace ConsoleApp { | |
class Program { | |
private static SqlConnection Connect() { |
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.Data.SqlClient; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Dapper; | |
namespace UnitTest { | |
public static class AssertHelper { | |
public static void IsSequenceEqualTo<T>(this IEnumerable<T> first, IEnumerable<T> second) { |
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.Web; | |
namespace WebApp.App_Code { | |
public class SampleHttpHandler : IHttpHandler { | |
public bool IsReusable { | |
get { return false; } | |
} | |
public void ProcessRequest(HttpContext context) { |
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.IO; | |
using System.Linq; | |
using System.Text; | |
using Newtonsoft.Json; | |
namespace ConsoleApp { | |
class User { | |
[JsonProperty("first_name")] |
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.IO; | |
using System.Linq; | |
using System.Text; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
namespace ConsoleApp { | |
class User { |
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.Data.SqlClient; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Dapper; | |
namespace UnitTest { | |
[TestClass] | |
public class Test { | |
private readonly string _connectionString = |