/
AspNetMvcContext.cs
98 lines (89 loc) · 3.92 KB
/
AspNetMvcContext.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Coderr.Client.AspNet.Mvc5
{
/// <summary>
/// Bring MVC specific sources
/// </summary>
public class AspNetMvcContext : AspNetContext
{
/// <summary>
/// Creates a new instance of <see cref="AspNetMvcContext" />.
/// </summary>
/// <param name="reporter">object triggering the collection</param>
/// <param name="exception">caught exception</param>
/// <param name="httpContext">context that the exception was thrown on</param>
/// <exception cref="ArgumentNullException">reporter;exception</exception>
public AspNetMvcContext(object reporter, Exception exception, HttpContextBase httpContext) : base(reporter,
exception, httpContext)
{
}
/// <summary>
/// Controller (if a controller was involved in the "incident")
/// </summary>
/// <remarks>
/// <para>
/// May or may not be specified depending on where the collection process was started from. Not everything can be
/// collected when using <c>Err.Report</c> instead of <c>controller.ReportException</c>.
/// </para>
/// </remarks>
public ControllerBase Controller { get; set; }
/// <summary>
/// ModelState if any
/// </summary>
/// <remarks>
/// <para>
/// May or may not be specified depending on where the collection process was started from. Not everything can be
/// collected when using <c>Err.Report</c> instead of <c>controller.ReportException</c>.
/// </para>
/// </remarks>
public IDictionary<string, ModelState> ModelState { get; set; }
/// <summary>
/// RouteData if any
/// </summary>
/// <remarks>
/// <para>
/// May or may not be specified depending on where the collection process was started from. Not everything can be
/// collected when using <c>Err.Report</c> instead of <c>controller.ReportException</c>.
/// </para>
/// </remarks>
public RouteData RouteData { get; set; }
/// <summary>
/// Specified if we find it somewhere (like in a controller). Might be empty though..
/// </summary>
/// <remarks>
/// <para>
/// May or may not be specified depending on where the collection process was started from. Not everything can be
/// collected when using <c>Err.Report</c> instead of <c>controller.ReportException</c>.
/// </para>
/// </remarks>
public TempDataDictionary TempData { get; set; }
/// <summary>
/// ViewBag if any
/// </summary>
/// <remarks>
/// <para>
/// May or may not be specified depending on where the collection process was started from. Not everything can be
/// collected when using <c>Err.Report</c> instead of <c>controller.ReportException</c>.
/// </para>
/// </remarks>
public object ViewBag { get; set; }
/// <summary>
/// ViewData if any
/// </summary>
/// <remarks>
/// <para>
/// May or may not be specified depending on where the collection process was started from. Not everything can be
/// collected when using <c>Err.Report</c> instead of <c>controller.ReportException</c>.
/// </para>
/// </remarks>
public ViewDataDictionary ViewData { get; set; }
/// <summary>
/// Model in the action method (if specified/loaded)
/// </summary>
public object Model { get; set; }
}
}