As configured in my dotfiles.
start new:
tmux
start new with session name:
module CustomerEndpoints | |
let ``GET /customers/list`` (repository: ICustomerRepository) = | |
repository.List | |
|> Seq.map customerToViewRecord | |
type GetCustomerInput = {Id: int;} | |
let ``GET /customers/{Id}`` (repository: ICustomerRepository) (input: GetCustomerInput) = | |
repository.Get input.Id |> customerToViewRecord |
As configured in my dotfiles.
start new:
tmux
start new with session name:
using MvcSample.Web.Models; | |
namespace MvcSample.Web | |
{ | |
public class HomeController | |
{ | |
public User Index() | |
{ | |
var user = new User | |
{ |
public class ViewDataForActivation | |
{ | |
[Activate] | |
public ViewDataDictionary ViewData { get; set; } | |
} |
public class Startup | |
{ | |
public void Configure(IApplicationBuilder app) | |
{ | |
app.UseStaticFiles(); | |
app.UseServices(services => | |
{ | |
services.AddMvc(); | |
services.SetupOptions<MvcOptions>(x => |
public class DependencyWrapper : Wrapper | |
{ | |
private readonly object dependency; | |
public DependencyWrapper(Type behaviorType, object dependency) : base(behaviorType) | |
{ | |
this.dependency = dependency; | |
} | |
protected override FubuMVC.Core.Registration.ObjectGraph.ObjectDef buildObjectDef() |
MongoConfiguration.Initialize(c => c.AddMap<PersonMap>()); | |
using (var db = Mongo.Create("mongodb://localhost/test")) | |
{ | |
var people = db.GetCollection<Person>(); | |
people.Save(new Person { FirstName = "myfirst", LastName = "mylast" }); | |
var person = (from p in people.AsQueryable() | |
where p.FirstName == "myfirst" | |
select p).Single(); | |
Console.WriteLine(person.FirstName + " " + person.LastName); | |
} |
var order = db.GetCollection<Order>().Find(new { }) | |
.Include(o => o.ProductsOrdered) | |
.First(); |
<link href="~/Content/Site.css" type="text/css" rel="stylesheet" /> | |
<script src="~/Scripts/jquery-1.4.1.js" type="text/javascript" language="javascript" /> |
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) |