-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/SkillsFundingAgency/das-e…
…mployerapprenticeshipsservice into MAC-80-content-terms-of-use
Showing
7 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -690,4 +690,4 @@ | |
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> --> | ||
</Project> | ||
</Project> |
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
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
26 changes: 26 additions & 0 deletions
26
src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/Attributes/DeprecatedAttribute.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using NLog; | ||
using System; | ||
using System.Web.Mvc; | ||
|
||
namespace SFA.DAS.EAS.Infrastructure.Attributes | ||
{ | ||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] | ||
public class DeprecatedAttribute : ActionFilterAttribute | ||
{ | ||
private static readonly ILogger Logger = LogManager.GetCurrentClassLogger(); | ||
|
||
public override void OnActionExecuting(ActionExecutingContext filterContext) | ||
{ | ||
var urlReferrer = filterContext.RequestContext.HttpContext.Request.UrlReferrer; | ||
var referrer = urlReferrer == null ? "unknown" : urlReferrer.ToString(); | ||
|
||
var rawUrl = filterContext.RequestContext.HttpContext.Request.RawUrl; | ||
|
||
var controllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; | ||
var actionName = filterContext.ActionDescriptor.ActionName; | ||
|
||
Logger.Info($"To track Apprentice V1 details landing on EAS: UrlReferrer Request: {referrer} Request to Page: {rawUrl} Handled At: {controllerName}.{actionName}"); | ||
base.OnActionExecuting(filterContext); | ||
} | ||
} | ||
} |
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