HTTP GET /stores => Get the stores
HTTP GET /stores/{storeId} => Get a single store.
HTTP GET /products => Get the products
HTTP GET /products/{productId} => Get a single product.
UriTemplate template = new UriTemplate("/foo/{bar}/baz?haz={haz}"); | |
template.SetParameter("foo", 1234); | |
template.SetParameter("haz", new[] { "foo", "bar" }); | |
string uri = template.Resolve(); |
function init() { | |
// initialize slider tooltip | |
var value = $('#hdnLicenceCount').val(), | |
$slider = $(".noUiSlider"), | |
properPlan = _.last(_.sortBy(_.filter(monthlyRates, function (selectedPlan) { | |
return selectedPlan.licenseCount <= value; | |
}), function (selectedPlan) { | |
return selectedPlan.licenseCount; | |
})); |
public class Car { | |
public int Id { get; set; } | |
[Required] | |
[StringLength(20)] | |
public string Make { get; set; } | |
[Required] | |
[StringLength(20)] |
public abstract class OwinController : Controller | |
{ | |
private const string OwinEnvironmentKey = "owin.Environment"; | |
protected OwinRequest OwinRequest { get { return GetOwinRequest(HttpContext); } } | |
protected OwinResponse OwinResponse { get { return GetOwinResponse(HttpContext); } } | |
protected virtual void SignIn(ClaimsPrincipal principal) | |
{ | |
} |
using Autofac; | |
using System; | |
using Xunit; | |
namespace FuncOfIServiceProviderSample | |
{ | |
public interface IFoo: IDisposable | |
{ | |
void Write(string msg); | |
} |
using Newtonsoft.Json; | |
using System; | |
using Xunit; | |
namespace JsonNetTimeSpanTests | |
{ | |
public class Model | |
{ | |
public string Name { get; set; } | |
public TimeSpan Interval { get; set; } |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Data.SqlClient; | |
using System.Configuration; | |
using System.Data; | |
using System.Threading.Tasks; | |
namespace AsyncDatabaseCall.Models { |
public static class Extensions { | |
public static IEnumerable<T> Select<T>( | |
this SqlDataReader reader, Func<SqlDataReader, T> projection) { | |
while (reader.Read()) { | |
yield return projection(reader); | |
} | |
} | |
} |
public class Configuration(IAppBuilder app) | |
{ | |
// TaskCompletionSource | |
app.Map("/streaming-api1", map => | |
{ | |
// Streaming API using SignalR | |
var connectionContext = GlobalHost.ConnectionManager.GetConnectionContext<RawConnection>(); | |
map.Run(async context => | |
{ |