わんくま同盟 大阪勉強会 #32 で Azure の話をします - お だ のスペース で書いたように、セッションをやらせていただきました。
まず一言、失敗したなぁ〜と。デモが思ったより時間掛かってしまい、おまけの SQL Azure の話しが殆ど出来なかった。
コードの解説とかするつもりなかったのに、すこし話してしまったのが失敗の原因かも。しかも、少ししか解説しなかったら聞いている人たちも理解しにくかったんじゃないかなと思う。
まだ、アンケートの結果は頂いていないので実際の所どうなのかは分からないけど。
次なんか話す機会があれば、もっとうまく出来るようになる!
セッション中にちらっと話した、Table Storage の Visual Studio 用テンプレートを一応晒します。(もっといいの誰かが作ってるかも)
セッションに使ったデモは、Azure SDK のサンプルの StorageClient のソースを配布していいのか分からないので公開はとりあえず控えます。
TableStorageEntityClass.cs
using System; using System.Linq; using System.Web; using Microsoft.Samples.ServiceHosting.StorageClient; namespace $rootnamespace$ { public class $safeitemname$ : TableStorageEntity { public $safeitemname$() : base() { } public $safeitemname$(string partitionKey, string rowKey) : base(partitionKey, rowKey) { } // Write Properties } public class $safeitemname$DataServiceContext : TableStorageDataServiceContext { public $safeitemname$DataServiceContext(StorageAccountInfo account) : base(account) { } public const string TableName = "$safeitemname$Table"; public IQueryable<$safeitemname$> $safeitemname$Table { get { return CreateQuery<$safeitemname$>(TableName); } } } }MyTemplate.vstemplate
<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> <TemplateData> <DefaultName>TableStorageEntityClass.cs</DefaultName> <Name>TableStorageEntity クラス</Name> <Description>Azure Table Storage の Entity クラスです。</Description> <ProjectType>CSharp</ProjectType> <SortOrder>10</SortOrder> <Icon>__TemplateIcon.ico</Icon> </TemplateData> <TemplateContent> <References> <Reference> <Assembly>System.Data.Services.Client</Assembly> </Reference> </References> <ProjectItem SubType="Code" TargetFileName="$fileinputname$Entity.cs" ReplaceParameters="true">TableStorageEntityClass.cs</ProjectItem> </TemplateContent> </VSTemplate>
テンプレートの作り方は、以前 項目テンプレート(ItemTemplate)の作成で嵌ったこと - お だ のスペース で書きましたが、MSDN 方法 : 複数ファイルの項目テンプレートを作成する を参考に。