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
type CustomBinder() = | |
interface IModelBinder with | |
member this.BindModel(actionContext:HttpActionContext, bindingContext :ModelBindingContext) = | |
let qs = HttpUtility.ParseQueryString(actionContext.Request.RequestUri.Query) | |
bindingContext.Model <- | |
if (qs.AllKeys |> Seq.exists(fun q -> q.ToLower() = bindingContext.ModelName.ToLower())) then | |
qs.[bindingContext.ModelName] |> Some | |
else | |
None | |
true |
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 class ModelUrlResolutionCache : IModelUrlResolver | |
{ | |
static Cache<string, string> _inputModelTypeCache; | |
public ModelUrlResolutionCache(IUrlRegistry urlRegistry, BehaviorGraph graph) | |
{ | |
if (_inputModelTypeCache == null) | |
_inputModelTypeCache = new Cache<string, string>(inputModel => | |
{ | |
var inputType = Type.GetType(inputModel) |
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
@model EditUserModel | |
@using (Html.BeginForm()) | |
{ | |
<div> | |
@Html.HiddenFor(m => m.Id) | |
@Html.TextBoxFor(m => m.FirstName) | |
@Html.TextBoxFor(m => m.LastName) | |
@Html.DropDownListFor(m => m.CountryId, Model.Countries) | |
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 class DownloadDataModel | |
{ | |
public string Data { get; set; } | |
public string Filename { get; set; } | |
public string MimeType { get; set; } | |
} | |
public class DownloadDataBehavior : BasicBehavior | |
{ | |
private readonly IFubuRequest _request; |
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 class JsonNetResult : JsonResult | |
{ | |
private readonly static JsonSerializerSettings Settings; | |
private readonly static IsoDateTimeConverter _dateTimeConverter; | |
static JsonNetResult() | |
{ | |
_dateTimeConverter = new IsoDateTimeConverter(); | |
// Default for IsoDateTimeConverter is yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK | |
_dateTimeConverter.DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFK"; |
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
start /wait msiexec /i Octopus.Tentacle.<version>.msi /quiet INSTALLLOCATION=C:\Octopus | |
cd C:\Octopus\Agent | |
tentacle configure --appdir="C:\Applications" --port=10933 --trust=<server-thumbprint> | |
tentacle new-certificate | |
tentacle install | |
tentacle register-with --server=<server-url> --environment=<environment> --role=<role> --apikey=<some-user-apikey> | |
octo deploy-release --project=<project-name> --deployto=<environment-to-deploy> --version=<version-to-deploy> --server=<server-url> --apikey=<some-user-apikey> |
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.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using Raven.Abstractions.Data; | |
using Raven.Abstractions.Indexing; | |
using Raven.Client; | |
using Raven.Client.Linq; |
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 class Group | |
{ | |
public Group() | |
{ | |
Users = new List<string>(); | |
ChildGroups = new List<string>(); | |
} | |
public string Id { get; set; } | |
public string Name { get; set; } |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.define "vagrant-windows" | |
config.vm.box = "windows2008r2" | |
# You should be using the vagrant-windows Vagrant Plugin! | |
# Admin user name and password | |
config.winrm.username = "Administrator" |
OlderNewer