This file contains 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 System.Threading.Tasks; | |
namespace SequenceGenerator | |
{ | |
public class SequenceGenerator | |
{ |
This file contains 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
var config = new HttpConfiguration(); | |
config.Routes.MapHttpRoute("Foo", "foo/{id}", new { controller = "foo" }); | |
config.Routes.MapHttpRoute("Bar", "bar/{id}", new { controller = "bar" }); | |
var requestMessage = new HttpRequestMessage(HttpMethod.Get, "/"); | |
requestMessage .Properties[HttpPropertyKeys.HttpConfigurationKey] = config ; | |
var vp = config.Routes.GetVirtualPath(requestMessage, "Foo" , new Dictionary<string,object> { { "controller", "foo" }, { "id", 10 } }); | |
Console.WriteLine(vp); |
This file contains 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.Http.Controllers; | |
using DependencyResolver.Controllers; | |
using Raven.Client; | |
using Raven.Client.Embedded; | |
using StructureMap.Configuration.DSL; | |
namespace DependencyResolver | |
{ | |
public class ControllerRegistry : Registry | |
{ |
This file contains 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 DependencyResolver : IDependencyResolver | |
{ | |
private readonly IContainer container; | |
public DependencyResolver(IContainer container) | |
{ | |
this.container = container; | |
} | |
public object GetService(Type serviceType) | |
{ |
This file contains 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.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using WebAPIKoans.MessageHandlers; | |
using NUnit.Framework; |
This file contains 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.Net; | |
using System.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web; | |
namespace WebAPIKoans.MessageHandlers |
This file contains 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 Customer | |
{ | |
private string name; | |
private string email; | |
public Customer(string name,string email) | |
{ | |
this.name=name; | |
this.email=email; | |
} | |
public void sendMail() |
This file contains 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
var vistor = new customer("vistor", "vistor@gmail.com"); | |
console.log(vistor.name) // this is not a private variable. ooch!! |
This file contains 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
/// <summary> | |
/// Url for the POST is http://localhost/api/todo | |
/// </summary> | |
/// <param name="item">Creates the Todo ITEM</param> | |
/// <returns></returns> | |
public HttpResponseMessage Post(TodoItem item) | |
{ | |
try | |
{ | |
if (string.IsNullOrEmpty(item.Description)) |
This file contains 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; | |
namespace RuleComposer.Test | |
{ | |
public class CustomerSpecification:SpecificationFor<Customer> | |
{ | |
public CustomerSpecification() |
OlderNewer