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 AutoStartupTest | |
| { | |
| using Owin; | |
| public interface INancyOwinStartup | |
| { | |
| void Configuration(IAppBuilder builder); | |
| } | |
| } |
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 TestModule : Nancy.NancyModule | |
| { | |
| public TestModule() | |
| { | |
| Get["/"] = _ => | |
| { | |
| return "I am sync!"; | |
| }; | |
| Get["/async"] = async _ => |
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="razor" type="Nancy.ViewEngines.Razor.RazorConfigurationSection, Nancy.ViewEngines.Razor" /> | |
| </configSections> | |
| <system.web> | |
| <compilation debug="true" targetFramework="4.5"> | |
| <buildProviders> | |
| <add extension=".cshtml" type="Nancy.ViewEngines.Razor.BuildProviders.NancyCSharpRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" /> | |
| <add extension=".vbhtml" type="Nancy.ViewEngines.Razor.BuildProviders.NancyVisualBasicRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" /> |
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 ConsoleApplication2 | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Globalization; | |
| using System.Text.RegularExpressions; | |
| /// <summary> | |
| /// Simplistic pluraliser | |
| /// </summary> |
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 (!this.stream.CanSeek) | |
| { | |
| var tcs = new TaskCompletionSource<Stream>(); | |
| var buffer = | |
| new MemoryStream((int)this.stream.Length); | |
| this.stream.CopyTo(buffer, (source, destination, ex) => | |
| { | |
| if (ex != null) | |
| { |
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"?> | |
| <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |
| <PropertyGroup> | |
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |
| <ProductVersion> | |
| </ProductVersion> | |
| <SchemaVersion>2.0</SchemaVersion> | |
| <ProjectGuid>{904E3B5F-F4E8-44DD-91E9-B7674DBBC84D}</ProjectGuid> |
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
| System.NotSupportedException | |
| Unable to discover CLR Type for model by the name of Nancy.ViewEngines.Razor.Tests.Models.Person. | |
| Try using a fully qualified type name and ensure that the assembly is added to the configuration file. | |
| AppDomain Assemblies: | |
| mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 | |
| xunit, Version=1.9.0.1566, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c | |
| Nancy.ViewEngines.Razor.Tests, Version=0.16.1.0, Culture=neutral, PublicKeyToken=null | |
| System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 |
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.Async | |
| { | |
| using System; | |
| using System.Net.Http; | |
| using System.Threading.Tasks; | |
| public class MainModule : NancyModule | |
| { | |
| public MainModule() | |
| { |
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 NancyKatana | |
| { | |
| using System; | |
| using System.Threading.Tasks; | |
| using Nancy; | |
| using NancyKatana.Models; | |
| public class WhyDoIAlwaysCallTheseThingsMainModule : NancyModule |
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
| [beep@pinky monotest]$ mono test.exe 12 | |
| Converting 12 | |
| Converted reported IsValid as True | |
| Conversion successful 12 | |
| [beep@pinky monotest]$ mono test.exe fred | |
| Converting fred | |
| Converted reported IsValid as True | |
| Conversion failed System.Exception: fred is not a valid value for Int32. ---> System.FormatException: Input string was not in the correct format | |
| at System.Int32.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in <filename unknown>:0 | |
| at System.ComponentModel.Int32Converter.ConvertFromString (System.String value, System.Globalization.NumberFormatInfo format) [0x00000] in <filename unknown>:0 |