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 Dapper; | |
@{ | |
using( var cn = new System.Data.SqlServerCe.SqlCeConnection("接続文字列")) | |
{ | |
cn.Open(); | |
using(var tr = cn.BeginTransaction()){ | |
try | |
{ | |
// Executeメソッドの第三引数にトランザクションオブジェクトを渡す | |
cn.Execute("UPDATE users SET Age = @Age Where ID = @ID", new {Age = 25 , ID = 1} , tr); |
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 Dapper; | |
@{ | |
IEnumerable< UserEntity> users; | |
using( var cn = new System.Data.SqlServerCe.SqlCeConnection("接続文字列")) | |
{ | |
cn.open(); | |
users = cn.Query<UserEntity>( "SELECT * FROM users"); | |
} | |
} | |
<!DOCTYPE html> |
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 Dapper; | |
@{ | |
dynamic users; | |
using( var cn = new System.Data.SqlServerCe.SqlCeConnection("接続文字列")) | |
{ | |
cn.open(); | |
users = cn.Query("SELECT * FROM users"); | |
} | |
} | |
<!DOCTYPE html> |
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 Dapper; |
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
namespace WebRole1 | |
{ | |
[HubName("hello")] | |
public class HelloHub : Hub | |
{ | |
public void Hello( string name) | |
{ | |
Clients.All.SayHello( "hello , " + name); | |
} | |
} |
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
// 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 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
<!-- プロジェクトがチェックアウトされていないか確認するタスク --> | |
<UsingTask TaskName="CheckedInDoneTask" | |
TaskFactory="CodeTaskFactory" | |
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | |
<ParameterGroup> | |
<TfsCollectionUrl ParameterType="System.String" Required="true" /> | |
<TfsTargetSourceFolder ParameterType="System.String" Required="true" /> | |
</ParameterGroup> | |
<Task> | |
<Reference Include="Microsoft.TeamFoundation.Client" /> |
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 Microsoft.Build.Utilities; | |
using Microsoft.Build.Framework; | |
using Microsoft.TeamFoundation.Client; | |
using Microsoft.TeamFoundation.VersionControl.Client; | |
namespace Build.Utils |
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.Net; | |
using System.IO; | |
using System.Diagnostics; | |
namespace TinyWebDav | |
{ | |
/// <summary> | |
/// 簡易WebDAVクライアントクラス | |
/// </summary> |
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
$client = New-Object System.Net.WebClient | |
$client.Encoding =[System.Text.Encoding]::UTF8 | |
$string = $client.downloadstring("http://winscript.jp/powershell/rss2/") | |
$xml=[xml]$string | |
$items = $xml.rss.channel.item | |
foreach($item in $items) | |
{ | |
$item.title | |
} |