This file contains hidden or 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; | |
namespace CG2.ExamplePOC | |
{ | |
public class WithDrawCashContext : WithDrawCashHandler | |
{ | |
protected Guid CardId = Guid.NewGuid(); | |
protected Guid AccountId = Guid.NewGuid(); | |
protected Guid AtmId = Guid.NewGuid(); | |
} |
This file contains hidden or 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; | |
namespace CG2.FluentContent | |
{ | |
// note that I currnelty do not have any testing libs or Nancy available | |
public class ContentProviderSpecs | |
{ | |
public void A_content_provider_should_respond_to_available_content_types() | |
{ |
This file contains hidden or 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.Linq; | |
using System.Text; | |
using Simple.Data; | |
using Nancy; | |
using Org.NerdBeers.Web.Models; | |
namespace Org.NerdBeers.Web.Modules | |
{ |
This file contains hidden or 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 string ResolveViewPath(string appviewpath, string viewname,string modulename,string[] allowedextensions) | |
{ | |
// find all possible extensions for this viewname | |
var possibleExtensions = new List<string>(); | |
var ext = Path.GetExtension(viewname); | |
if (string.IsNullOrEmpty(ext)) | |
possibleExtensions.AddRange(allowedextensions); | |
else | |
possibleExtensions.Add(ext); | |
// get the filename without an extension |
This file contains hidden or 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
Server Error in '/' Application. | |
Object reference not set to an instance of an object. | |
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. | |
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. | |
Source Error: | |
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
This file contains hidden or 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.Web | |
@using System.Web.Security | |
<style type="text/css"> | |
p,label {color:black;} | |
</style> | |
@{ | |
// just refactored things a bit | |
var flashmessage = Request["flash"]; |
This file contains hidden or 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 BrowserFixture | |
{ | |
private readonly Browser browser; | |
public BrowserFixture() | |
{ | |
var bootstrapper = | |
new FakeDefaultNancyBootstrapper(); | |
this.browser = new Browser(bootstrapper); |
This file contains hidden or 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
<content name="script"> | |
<script type="text/coffeescript"> | |
$().ready -> | |
$("*[data-uri]").each (el) -> | |
rendertemplate = Tempo.prepare(el); | |
uri = el.attribute "data-uri" | |
refresh = el.attribute "data-refresh" | |
$.retrieveJSON uri , {}, (data) -> | |
rendertemplate.render data |
This file contains hidden or 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
//---><8--------------------------- UI loads viewmodels and generates commands ---- | |
UI.Viewmodel = ViewModelStore.Query(UI.SomeParameters); | |
UI.HandleInput = GeneratedCommand => CommandStore.Add(GeneratedCommand); | |
//---><8--------------------------- Commands to events ----------------------------------------- | |
// This uses an iterator because a command should only be handled once | |
while(CommandStore.HasCommands) |
This file contains hidden or 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
// Checked blog at http://blog.markrendle.net/2011/05/23/simple-data-0-6-5/ | |
// and code at https://github.com/markrendle/Simple.Data/blob/master/Simple.Data/SimpleQuery.cs | |
int? previousPhotoId = DB.Photos.Query() | |
.Select(DB.Photos.Id) | |
.Where(DB.Photos.Published == true && DB.Photos.DatePublished < currentPhoto.DatePublished.Value) | |
.OrderByDatePublishedDescending() | |
.ToScalarOrDefault<int?>(); | |
int? nextPhotoId = DB.Photos.Query() |