Assuming you have the following object:
public class Person {
public string Name { get; set; }
public string Surname { get; set; }
public int Age { get; set; }
}
and got a PATCH request as below:
public class MvcApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
ObjectFactory.Configure(cfg => | |
{ | |
cfg.For<IEmailValidator>().Use<EmailValidator>(); | |
}); |
Assuming you have the following object:
public class Person {
public string Name { get; set; }
public string Surname { get; set; }
public int Age { get; set; }
}
and got a PATCH request as below:
[TestMethod()] | |
public void Foo_should_start_mspaint() | |
{ | |
var cmdHandler = new Mock<ICommandHandler>(); | |
var qryHandler = new Mock<IQueryHandler>(); | |
var controller = new Controller(cmdHandler.Object, qryHandler.Object); | |
controller.Foo("mspaint.exe"); | |
namespace OAuthDemo.Controllers | |
{ | |
public static class SecurityConfig | |
{ | |
public static void Configure(HttpConfiguration httpConfiguration) | |
{ | |
var config = new AuthenticationConfiguration(); | |
config.DefaultAuthenticationScheme = "Basic"; | |
.ui-autocomplete { | |
position: absolute; | |
cursor: default; | |
list-style: none; | |
display: block; | |
outline: none; | |
padding: 5px 0; | |
margin: 2px 0 0; | |
background-color: @dropdownBackground; | |
border: 1px solid #ccc; // Fallback for IE7-8 |
public class LessTransform : IBundleTransform | |
{ | |
public void Process(BundleContext context, BundleResponse bundle) | |
{ | |
if (context == null) | |
{ | |
throw new ArgumentNullException("context"); | |
} | |
if (bundle == null) |
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
});
public static class CloudBlobExtensions | |
{ | |
/// <summary> | |
/// Uploads a string of text to a block blob. | |
/// </summary> | |
/// <param name="content">The text to upload, encoded as a UTF-8 string.</param> | |
public static void UploadText(this ICloudBlob blob, string content) | |
{ | |
UploadText(blob, content, Encoding.UTF8, null); | |
} |
public HttpContextBase FakeHttpContext() { | |
var context = new Mock<HttpContextBase>(); | |
var files = new Mock<HttpFileCollectionBase>(); | |
var request = new Mock<HttpRequestBase>(); | |
var response = new Mock<HttpResponseBase>(); | |
var session = new Mock<HttpSessionStateBase>(); | |
var server = new Mock<HttpServerUtilityBase>(); | |
var user = new Mock<IPrincipal>(); | |
var identity = new Mock<IIdentity>(); | |
request.Setup(req => req.ApplicationPath).Returns("~/"); |
public static class HttpErrorExtensions | |
{ | |
public static ModelStateDictionary GetModelState(this HttpError httpError) | |
{ | |
Ensure.Argument.NotNull(httpError, "httpError"); | |
object serialized; | |
if (httpError.TryGetValue("ModelState", out serialized)) | |
{ | |
var modelState = new ModelStateDictionary(); |