Skip to content

Instantly share code, notes, and snippets.

View jasonmitchell's full-sized avatar

Jason Mitchell jasonmitchell

View GitHub Profile
@using Quickstart.Web.Extensions
@model Quickstart.Web.Models.Person
@section scripts
{
<script type="text/javascript">
var viewModel = ko.mapping.fromJS(@Html.Raw(Model.ToJson()));
ko.applyBindings(viewModel);
</script>
}
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Quickstart.Web.Extensions
{
public static class ObjectExtensions
{
public static string ToJson(this object obj)
{
JsonSerializerSettings serializerSettings = new JsonSerializerSettings
using NHibernate;
using NUnit.Framework;
namespace UnitTests
{
public abstract class AbstractInMemoryDataFixture
{
private ISession session;
[SetUp]
<#@ template debug="true" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#@ Assembly Name="System.Core" #>
<#@ Assembly Name="System.Windows.Forms" #>
<#@ Assembly Name="System.Web.Mvc" #>
<#@ assembly name="$(SolutionDir)MyProject.WebApplication\bin\MyProject.WebApplication.dll" #>
<#@ import namespace="System" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Diagnostics" #>
<#@ import namespace="System.Linq" #>
<local:ThemeAwarePanorama Title="my app"
LightBackground="/MyApp;component/Content/Images/Light/Background.jpg"
DarkBackground="/MyApp;component/Content/Images/Dark/Background.jpg">
<!-- more xaml -->
</local:ThemeAwarePanorama>
public class Customer
{
[Key]
public int ID { get; set; }
[Required]
public string FirstName { get; set; }
[Required]
public string LastName { get; set; }