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
| static class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var test = new Test(); | |
| Console.WriteLine(test.GetFugaString(x => x.TestProperty)); | |
| Console.Read(); | |
| } | |
| public static string GetFugaString<TSource, TSelector>(this TSource source, Expression<Func<TSource, TSelector>> propertyExpression) where TSource : class |
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.ObjectModel; | |
| using System.Linq; | |
| namespace インデクサにデリゲート { | |
| class Program { | |
| static void Main(string[] args) { | |
| SampleCollection sample = SampleCollection.My; | |
| sample.Add(new Hoge() { ID = 1, Name = "A" }); | |
| sample.Add(new Hoge() { ID = 2, Name = "B" }); |
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.Linq; | |
| using System.Text; | |
| namespace Linqメソッドで遊ぶ | |
| { | |
| class Program | |
| { | |
| static void Main(string[] 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 System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Linqメソッドで遊ぶ | |
| { | |
| class Program | |
| { | |
| static void Main(string[] 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 System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Linqメソッドで遊ぶ | |
| { | |
| class Program | |
| { | |
| static void Main(string[] 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 System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Reflection; | |
| namespace Enumに柔軟な拡張を追加する試み { | |
| class Program { | |
| enum tesyEnum { | |
| [Obsolete] |
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
| class Program{ | |
| static void Main(string[] args){ | |
| //参照型の値渡し | |
| TestClass t1 = new TestClass(); | |
| TestClass t2 = ValMethod(t1); | |
| Console.WriteLine(t1 == t2);//false | |
| //参照型の参照渡し | |
| TestClass t3 = new TestClass(); |
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
| interface IData //データインターフェース | |
| { | |
| } | |
| public abstract class SchemaBase//DBスキーマ抽象クラス | |
| { | |
| public SchemaBase() { } | |
| } | |
| public abstract class DAOBase<TSchema, TData>//DAOパターン抽象クラス |
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
| interface IData //データインターフェース | |
| { | |
| } | |
| public abstract class SchemaBase//DBスキーマ抽象クラス | |
| { | |
| public SchemaBase() { } | |
| } | |
| public abstract class DAOBase<TSchema, TData>//DAOパターン抽象クラス |
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
| class Program | |
| { | |
| [STAThread] | |
| static void Main(string[] args) | |
| { | |
| TestFlag f = TestFlag.b | TestFlag.d; //bとdにフラグを立てる | |
| Console.WriteLine("{0}", f.HasFlag(TestFlag.a)); | |
| Console.WriteLine("{0}", f.HasFlag(TestFlag.b)); | |
| Console.WriteLine("{0}", f.HasFlag(TestFlag.c)); |
NewerOlder