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
| // wrap ASF Stateless Service. Customer would implement this base class instead of StatelessService | |
| public abstract class NServiceBusStatelessService : StatelessService, IProvideEndPointConfiguration | |
| { | |
| //plumbing for starting NSB on Service start | |
| protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners() | |
| { | |
| yield return new ServiceInstanceListener( | |
| createCommunicationListener: | |
| _ => new NServiceBusCommunicationsListener(this), | |
| name: |
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.Net; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace AppHarbor.Web { | |
| [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, | |
| AllowMultiple = false)] |
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
| internal static class RequestTrackingConstants | |
| { | |
| /// <summary> | |
| /// Name of the HttpContext item containing RequestTelemetry object. | |
| /// </summary> | |
| internal const string RequestTelemetryItemName = "Microsoft.ApplicationInsights.RequestTelemetry"; | |
| internal const string EndRequestCallFlag = "Microsoft.ApplicationInsights.EndRequestCallFlag"; | |
| /// <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
| class CapturingResponseFilter : Stream | |
| { | |
| private Stream _sink; | |
| private MemoryStream mem; | |
| public APIAccessLogItem AccessLogItem { get; set; } | |
| public CapturingResponseFilter(Stream sink, APIAccessLogItem item) | |
| { | |
| _sink = sink; |
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.Web; | |
| using System.Web.Mvc; | |
| using System.Text; | |
| using System.IO; | |
| using System.Web.UI; | |
| using Pechkin; | |
| using System.Text.RegularExpressions; |
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.Net; | |
| using System.Net.Http; | |
| using System.Web; | |
| using System.Web.Caching; | |
| using System.Web.Http.Controllers; | |
| using System.Web.Http.Filters; | |
| /// <summary> | |
| /// Decorates any Action that needs to have client requests limited by concurrent requests. |
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
| [AttributeUsage(AttributeTargets.Method)] | |
| public class ValidationActionFilterAttribute : ActionFilterAttribute | |
| { | |
| public override void OnActionExecuting(HttpActionContext actionContext) | |
| { | |
| InnerOnActionExecuting(actionContext); | |
| var modelState = actionContext.ModelState; | |
| if (modelState.IsValid) |
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.Configuration; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace Web.Attributes | |
| { | |
| public class RestrictByIpAddressAttribute : ActionFilterAttribute |
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 Auction.Web.Domain; | |
| using Auction.Web.Domain.Commands; | |
| using Auction.Web.Domain.Entities; | |
| using Auction.Web.Domain.Queries; | |
| using Facebook; | |
| using Microsoft.Web.WebPages.OAuth; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Configuration; | |
| using System.Linq; |
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 BeforeAttribute : ActionFilterAttribute { | |
| public BeforeAttribute() { | |
| Methods = string.Empty; | |
| Except = string.Empty; | |
| Only = string.Empty; | |
| } | |
| public BeforeAttribute(params string[] methodNames) : this() { | |
| Methods = string.Join(" ", methodNames); | |
| } |