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
declare @table varchar(50); | |
set @table = 'TableOrViewName'; | |
select 'public ' + tps.dest | |
+ (case when IS_NULLABLE = 'YES' and tps.dest != 'string' then '? ' else ' ' end) | |
+ column_name + ' { get; set; }' | |
from information_schema.columns c | |
join ( | |
select 'char' as origin, 'string' as dest union all | |
select 'varchar', 'string' union all |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" /> | |
</configSections> | |
<appSettings> | |
</appSettings> | |
<connectionStrings> | |
</connectionStrings> | |
<system.web> |
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
Error Details | |
Nancy.RequestExecutionException: Oh noes! ---> System.NullReferenceException: Object reference not set to an instance of an object. | |
at Views_home.Viewfb8e7c8d7e1547039246bf7c625fe9df.RenderViewLevel1() | |
at Views_home.Viewfb8e7c8d7e1547039246bf7c625fe9df.Render() | |
at Spark.SparkViewBase.RenderView(TextWriter writer) | |
at Nancy.ViewEngines.Spark.NancySparkView.Execute() | |
at Nancy.ViewEngines.Spark.SparkViewEngine.<>c__DisplayClass8.b__7(Stream stream) | |
at Nancy.Responses.MaterialisingResponse.PreExecute(NancyContext context) | |
at Nancy.NancyEngine.d__9.MoveNext() |
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
namespace Nancy.Demo.ModelBinding | |
{ | |
using System.Linq; | |
using Database; | |
using Models; | |
using Nancy.ModelBinding; | |
public class EventsModule : NancyModule | |
{ | |
public EventsModule() |
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
select 'replacewithtablename' into @table; | |
select 'replacewithdatabasename' into @schema; | |
select concat('public class ',@table,'{') | |
union | |
select concat('public ',tps.dest,' ',column_name,'{get;set;}') | |
from information_schema.columns c | |
join ( | |
select 'char' as orign ,'string' as dest union all |
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 AlphaController | |
{ | |
private readonly UrlRegistry _urlregistry; | |
public AlphaController(UrlRegistry urlreg) | |
{ | |
_urlregistry = urlreg; | |
} | |
public string Get_Alpha_Id_Name(AlphaInputModel input) |
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
// If using FubuAthentication, update auth ticket as needed (e.g. account creation or key updated) | |
private readonly IAuthenticationSession _auth; | |
public SomeController(IAuthenticationSession auth) { _auth = auth; } | |
_auth.MarkAuthenticated(user.Email); | |
// If using FubuAuthentication, make route available to anonymous users | |
[NotAuthenticated] | |
public FubuContinuation SomeRoute(SomeRouteInputModel input) | |
{ | |
// Use a continuation to redirect to input-less page |
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 FubuMVC.Core.Registration; | |
using FubuMVC.Core.Registration.Nodes; | |
using FubuMVC.Core.Resources.Conneg; | |
using FubuMVC.Core.Runtime.Formatters; | |
using FubuMVC.Json; | |
public class JsonBindingConvention : IConfigurationAction |
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 Simple.Data; | |
/// <summary> | |
/// Custom Simple Data pluralizer; makes an attempt to properly handle words ending in "y". | |
/// </summary> | |
public class Pluralizer : IPluralizer | |
{ | |
public bool IsSingular(string word) { return !IsPlural(word); } |