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.Net; | |
using System.IO; | |
using System.Diagnostics; | |
namespace TinyWebDav | |
{ | |
/// <summary> | |
/// 簡易WebDAVクライアントクラス | |
/// </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
// TFSのAPIを使って、ソースコードの最新をローカルに取得するサンプル | |
// 参考: | |
// MSDN | |
// http://msdn.microsoft.com/ja-jp/library/microsoft.teamfoundation.versioncontrol.client.workspace%28v=vs.100%29.aspx | |
// StacK Overflow | |
// http://stackoverflow.com/questions/8341419/get-latest-using-tfs-api | |
// http://stackoverflow.com/questions/1827651/how-do-you-get-the-latest-version-of-source-code-using-the-team-foundation-serve | |
using System; |
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
public partial class MainWindow : Window | |
{ | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
} | |
private void Button_Click(object sender, RoutedEventArgs e) | |
{ | |
var target = "https://hoge.fuga.example.com/hogehoge/"; |
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
void SomeMethod() | |
{ | |
using(var cn = new Oracle.DataAccess.Clinet.OracleConnection("接続文字列")){ | |
cn.Open(); | |
// -1 を 暗黙でtureとしてbool型にマッピングしてくれる。 | |
var r1 = cn.Query<Hoge>("SELECT -1 as IsFoo FROM DUAL"); | |
// 0 は false | |
var r2 = cn.Query<Hoge>("SELECT 0 as IsFoo FROM DUAL"); |
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
Get-Child | |
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
var = "aaa"; |
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 Glimpse.AspNet.Extensions; | |
using Glimpse.Core.Extensibility; | |
using System.Collections.Generic; | |
namespace DapperSampleWeb | |
{ | |
public class GlimpseSecurityPolicy:IRuntimePolicy | |
{ | |
public RuntimePolicy Execute(IRuntimePolicyContext policyContext) | |
{ |
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
cn.Open(); | |
var param = new | |
{ | |
// IN句に並べたい値をリストとして積んでやる | |
AgeList = new List<int>() { 20, 38 } | |
}; | |
var ret = cn.Query<UserEntity>("SELECT * FROM Users WHERE Age IN @AgeList ORDER BY ID", param).ToList(); |
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
DECLARE @arg varchar(MAX) = 'HOGEHOGE' | |
DECLARE @A varchar(MAX) = 'SELECT ''' + LEFT(@arg,4) + ''' as col1' | |
-- col1:HOGEで結果が返る | |
EXECUTE(@A) | |
-- エラーで実行できない | |
EXECUTE('SELECT ''' + LEFT(@arg,4) + ''' as col1') |
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
void SomeMethod(Hoge filler) | |
{ | |
using(var cn = new Oracle.DataAccess.Clinet.OracleConnection("接続文字列")){ | |
cn.Open(); | |
// -- NG NG NG NG NG NG -- | |
// NUMBER型のカラムis_fooに与えるパラメータIsFooをboolで与えると例外 | |
var r1 = cn.Query("SELECT * FROM Hoge WHERE is_foo = :IsFoo " , filler ); | |
// -- NG NG NG NG NG NG -- | |
NewerOlder