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
| use tempdb; | |
| create table #Folder( | |
| Id int, | |
| Name varchar(5), | |
| ParentId int null, | |
| constraint PK_Id primary key(Id), | |
| constraint FK_ParentId foreign key(ParentId) references #Folder(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
| if object_id('Sequence') is not null | |
| drop table Sequence; | |
| -- シーケンスのソース(共通テーブル式を使って1~50までの連番生成) | |
| with Source(Value) as( | |
| select 1 | |
| union all | |
| select Value + 1 | |
| from Source | |
| ) |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <nlog | |
| xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| <variable | |
| name="layout" | |
| value="${longdate}|${level}|${message}" /> | |
| <targets> |
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.Collections.Generic; | |
| using System.Collections.ObjectModel; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApp { | |
| class DefaultKeyedCollection<TKey, TItem> : KeyedCollection<TKey, TItem> { | |
| private readonly Func<TItem, TKey> _func; |
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.Collections.Generic; | |
| using System.Drawing; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Newtonsoft.Json; | |
| namespace ConsoleApp { | |
| class Settings { |
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
| document.addEventListener("DOMContentLoaded", function(event) { | |
| var toString = Object.prototype.toString; | |
| // 文字列リテラルを使ってcreateElementを呼び出すと、HTMLAnchorElement | |
| // オーバーロードが有効になる | |
| var element1 = document.createElement("a"); | |
| // エラーにならない | |
| element1.href; | |
| console.log(toString.apply(element1)); // [object HTMLAnchorElement] |
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.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace MvcApp.Controllers { | |
| [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
| public class SampleAttribute : FilterAttribute, IAuthorizationFilter, IActionFilter, IResultFilter, IExceptionFilter { |
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.Web; | |
| using System.Web.Mvc; | |
| namespace MvcApp { | |
| public class FilterConfig { | |
| public static void RegisterGlobalFilters(GlobalFilterCollection filters) { | |
| filters.Add(new SampleAttribute("Global")); | |
| } | |
| } | |
| } |
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
| if object_id('tempdb..#Test') is not null | |
| drop table #Test; | |
| select * | |
| into #Test | |
| from (values(1), (2)) as Test(Value) | |
| union all | |
| select * | |
| from (values(3), (4)) as Test(Value); |
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.Linq; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using AutoMapper; | |
| namespace Test { | |
| class User1 { | |
| public int Id { get; set; } | |
| public string Name { get; set; } | |
| } |