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="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core, Version=1.0.0, Culture=neutral"/> | |
</configSections> | |
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd"> | |
<logging level="Trace"/> | |
<runtimePolicies> | |
<ignoredTypes> | |
<add type="Glimpse.Core.Policy.ControlCookiePolicy, Glimpse.Core"/> |
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 (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnString"].ConnectionString)) | |
{ | |
var parameters = model.Keywords.Select((keyword, index) => new { Name = "@P" + index, Value = keyword }); | |
var sql = String.Format("SELECT * FROM Table WHERE Id IN ({0})", String.Join(",", parameters.Select(x => x.Name))); | |
connection.Open(); | |
using (var command = new SqlCommand(sql)) | |
{ | |
foreach (var p in parameters) | |
{ |
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
[AsyncStateMachine(typeof (Class1.<ExecuteAsync>d__0))] | |
[DebuggerStepThrough] | |
public Task ExecuteAsync() | |
{ | |
Class1.<ExecuteAsync>d__0 stateMachine; | |
stateMachine.<>4__this = this; | |
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create(); | |
stateMachine.<>1__state = -1; | |
stateMachine.<>t__builder.Start<Class1.<ExecuteAsync>d__0>(ref stateMachine); | |
return stateMachine.<>t__builder.Task; |
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 AsyncCommand1 : IAsyncCommand | |
{ | |
public Task ExecuteAsync() | |
{ | |
int x = 2 + 2; | |
return Task.FromResult(true); | |
} | |
} | |
public class AsyncCommand2 : IAsyncCommand |
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 interface IAsyncCommand | |
{ | |
Task ExecuteAsync(); | |
} |
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 interface IQueries | |
{ | |
Foo GetFoo(int fooId); | |
IEnumerable<Foo> QueryFooByBar(int barId); | |
} | |
public interface ICommands | |
{ | |
void AddFooToBar(int barId, Foo foo); | |
} |
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 interface IsEmailAlreadyInUse | |
{ | |
Task<bool> Execute(string emailAddress); | |
} | |
public interface CreateUser | |
{ | |
Task Execute(string username, string email); | |
} | |
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 interface IsEmailAlreadyInUse | |
{ | |
Task<bool> Execute(string emailAddress); | |
} | |
internal class SqlRepository : IsEmailAlreadyInUse | |
{ | |
Task<bool> IsEmailAlreadyInUse.Execute(string emailAddress) | |
{ | |
// Implementation goes here |
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.Net; | |
using System.Threading.Tasks; | |
using Xunit; | |
public class Fixture | |
{ | |
[Fact] | |
public void Should_FactMethodName() |
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 Nancy; | |
using Nancy.Testing; | |
using Nancy.Testing.Fakes; | |
using Xunit; | |
using Xunit.Extensions; |