本文整理汇总了C#中Exceptionless.Core.Models.PersistentEvent.GetRequestInfo方法的典型用法代码示例。如果您正苦于以下问题:C# PersistentEvent.GetRequestInfo方法的具体用法?C# PersistentEvent.GetRequestInfo怎么用?C# PersistentEvent.GetRequestInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exceptionless.Core.Models.PersistentEvent
的用法示例。
在下文中一共展示了PersistentEvent.GetRequestInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev) {
if (!ShouldHandle(ev))
return null;
var error = ev.GetError();
var stackingTarget = error?.GetStackingTarget();
if (stackingTarget?.Error == null)
return null;
dynamic data = new ExpandoObject();
data.Id = ev.Id;
data.Message = ev.Message;
if (!String.IsNullOrEmpty(stackingTarget.Error.Type)) {
data.Type = stackingTarget.Error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last();
data.TypeFullName = stackingTarget.Error.Type;
}
if (stackingTarget.Method != null) {
data.Method = stackingTarget.Method.Name;
data.MethodFullName = stackingTarget.Method.GetFullName();
}
var requestInfo = ev.GetRequestInfo();
if (!String.IsNullOrEmpty(requestInfo?.Path))
data.Path = requestInfo.Path;
return new SummaryData { TemplateKey = "event-error-summary", Data = data };
}
示例2: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev) {
if (!ShouldHandle(ev))
return null;
var stackingTarget = ev.GetStackingTarget();
if (stackingTarget?.Error == null)
return null;
var data = new Dictionary<string, object> { { "Id", ev.Id }, { "Message", ev.Message } };
if (!String.IsNullOrEmpty(stackingTarget.Error.Type)) {
data.Add("Type", stackingTarget.Error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last());
data.Add("TypeFullName", stackingTarget.Error.Type);
}
if (stackingTarget.Method != null) {
data.Add("Method", stackingTarget.Method.Name);
data.Add("MethodFullName", stackingTarget.Method.GetFullName());
}
var requestInfo = ev.GetRequestInfo();
if (!String.IsNullOrEmpty(requestInfo?.Path))
data.Add("Path", requestInfo.Path);
return new SummaryData { TemplateKey = "event-error-summary", Data = data };
}
示例3: GetIpAddresses
private IEnumerable<string> GetIpAddresses(PersistentEvent ev) {
if (!String.IsNullOrEmpty(ev.Geo) && (ev.Geo.Contains(".") || ev.Geo.Contains(":")))
yield return ev.Geo;
var request = ev.GetRequestInfo();
if (!String.IsNullOrWhiteSpace(request?.ClientIpAddress))
yield return request.ClientIpAddress;
var environmentInfo = ev.GetEnvironmentInfo();
if (String.IsNullOrWhiteSpace(environmentInfo?.IpAddress))
yield break;
foreach (var ip in environmentInfo.IpAddress.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
yield return ip;
}
示例4: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev) {
if (!ShouldHandle(ev))
return null;
var error = ev.GetSimpleError();
if (error == null)
return null;
var data = new Dictionary<string, object> { { "Message", ev.Message } };
if (!String.IsNullOrEmpty(error.Type)) {
data.Add("Type", error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last());
data.Add("TypeFullName", error.Type);
}
var requestInfo = ev.GetRequestInfo();
if (!String.IsNullOrEmpty(requestInfo?.Path))
data.Add("Path", requestInfo.Path);
return new SummaryData { TemplateKey = "event-simple-summary", Data = data };
}
示例5: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev) {
if (!ShouldHandle(ev))
return null;
var error = ev.GetSimpleError();
if (error == null)
return null;
dynamic data = new ExpandoObject();
data.Message = ev.Message;
if (!String.IsNullOrEmpty(error.Type)) {
data.Type = error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last();
data.TypeFullName = error.Type;
}
var requestInfo = ev.GetRequestInfo();
if (!String.IsNullOrEmpty(requestInfo?.Path))
data.Path = requestInfo.Path;
return new SummaryData { TemplateKey = "event-simple-summary", Data = data };
}