This enforces the rules of the “javascript: just the good parts”.
Specflow Scenarios example
Here is a great example of table based specflow.
Minimal Scaffolding for Visual Studio
Here is an article that explains the setup.
However to get started in four lines:
New Project
From NuGet Console:
Install-Package t4scaffolding
Scaffold CustomScaffolder MinimalDemo
Then you can simply use:
scaffold MinimalDemo -Project MinimalScaffolding
I will experiment with performing database and filessytem queries.
The demo project creates a MinimalDemo.ps1 and a minimal demo t4 template.
The demo looks like:
[T4Scaffolding.Scaffolder(Description = “Enter a description of MinimalDemo here”)][CmdletBinding()]
param(
[string]$Project,
[string]$CodeLanguage,
[string[]]$TemplateFolders,
[switch]$Force = $false,
[string]$Filename = “ExampleOutput”
)
$outputPath = $Filename # The filename extension will be added based on the template’s <#@ Output Extension=”…” #> directive
$namespace = (Get-Project $Project).Properties.Item(“DefaultNamespace”).Value
Add-ProjectItemViaTemplate $outputPath -Template MinimalDemoTemplate `
-Model @{ Namespace = $namespace; ExampleValue = “Hello, world!” } `
-SuccessMessage “Added MinimalDemo output at {0}” `
-TemplateFolders $TemplateFolders -Project $Project -CodeLanguage $CodeLanguage -Force:$Force
Note in this instance I have edited the param list to allow the filename to be specified on the command line.
Since data is passed into the template via the model parameter it is trivial to perform database or filesystem queries to enrich the data being passed to the item generated.
Combine this with version control and you can overwrite the existing version and merge back existing customisations.
We have MVC style one-shot code generation (with the force option to overwrite).
This is incredibly powerful. A few of these templates could save hours of work. Especially across a team.
Command Line TFS Access
There are a couple of useful powershell command-line tools that are of use:
This is useful to query tasks and work items
tfpt query “ProjectPath to query”
From a mapped folder allows the running of existing tfs work item queries from the command-line
It uses the current folders mapping to identify the project.
This is useful for quering checkins:
Run from the VS2012 command prompt:
tf history x:path_to_project /recursive /noprompt /user:”My User Name”
I've been forked
Here is a fork of my ruleset serializer.
Batching Azure Table Operations
In order to improve performance on Azure table operations it is advised to batch them.
However the documentation does not clearly state that the batch must all have the same PartionKey and may only contain 100 items.
Integrating DotNet and Node.js
Here is a the project.
GitHub Introduction For Cats
Here is a great intro to github for you and your cat.
Some Javascript Frameworks
http://www.asp.net/single-page-application/overview/templates/breezeangular-template
http://www.breezejs.com/?utm_source=ms-spa
http://www.hanselman.com/blog/TheBigGlossaryOfOpenSourceJavaScriptAndWebFrameworksWithCoolNames.aspx
These are some useful links on javascript frameworks.
jQuery is currently the best of breed for what it does.
Querying Azure Table Storage
Here is how to generically query Azure Table Storage without having to define the entity that is in the table (which you may not know and can vary).
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(diagnostics);
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
CloudTable cloudTable = tableClient.GetTableReference(“WADLogsTable”);
TableQuery query = new TableQuery();
query.FilterString = filter;
var items = cloudTable.ExecuteQuery(query).ToList();
See my previous post for how to set the filters.