本文整理汇总了C#中Exceptionless.Core.Models.PersistentEvent.GetUserIdentity方法的典型用法代码示例。如果您正苦于以下问题:C# PersistentEvent.GetUserIdentity方法的具体用法?C# PersistentEvent.GetUserIdentity怎么用?C# PersistentEvent.GetUserIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exceptionless.Core.Models.PersistentEvent
的用法示例。
在下文中一共展示了PersistentEvent.GetUserIdentity方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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 } };
AddUserIdentitySummaryData(data, ev.GetUserIdentity());
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 };
}
示例2: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev) {
if (!ShouldHandle(ev))
return null;
dynamic data = new ExpandoObject();
data.SessionId = ev.SessionId;
if (ev.IsSessionStart()) {
data.Value = ev.Value.GetValueOrDefault();
DateTime? endTime = ev.GetSessionEndTime();
if (endTime.HasValue)
data.SessionEnd = endTime;
}
var identity = ev.GetUserIdentity();
if (identity != null) {
if (!String.IsNullOrEmpty(identity.Identity))
data.Identity = identity.Identity;
if (!String.IsNullOrEmpty(identity.Name))
data.Name = identity.Name;
}
return new SummaryData { TemplateKey = "event-session-summary", Data = data };
}
示例3: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev)
{
if (!ShouldHandle(ev))
return null;
var data = new Dictionary<string, object> { { "Source", ev.Source } };
AddUserIdentitySummaryData(data, ev.GetUserIdentity());
return new SummaryData { TemplateKey = "event-feature-summary", Data = data };
}
示例4: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev)
{
var data = new Dictionary<string, object> {
{ "Message", GetStackTitle(ev) },
{ "Source", ev.Source },
{ "Type", ev.Type }
};
AddUserIdentitySummaryData(data, ev.GetUserIdentity());
return new SummaryData { TemplateKey = "event-summary", Data = data };
}
示例5: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev)
{
if (!ShouldHandle(ev))
return null;
var data = new Dictionary<string, object> { { "SessionId", ev.GetSessionId() }, { "Type", ev.Type } };
AddUserIdentitySummaryData(data, ev.GetUserIdentity());
if (ev.IsSessionStart()) {
data.Add("Value", ev.Value.GetValueOrDefault());
DateTime? endTime = ev.GetSessionEndTime();
if (endTime.HasValue)
data.Add("SessionEnd", endTime);
}
return new SummaryData { TemplateKey = "event-session-summary", Data = data };
}
示例6: 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 } };
AddUserIdentitySummaryData(data, ev.GetUserIdentity());
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 };
}
示例7: GetEventSummaryData
public override SummaryData GetEventSummaryData(PersistentEvent ev)
{
if (!ShouldHandle(ev))
return null;
var data = new Dictionary<string, object> { { "Message", ev.Message } };
AddUserIdentitySummaryData(data, ev.GetUserIdentity());
if (!String.IsNullOrWhiteSpace(ev.Source)) {
data.Add("Source", ev.Source);
var parts = ev.Source.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length > 1 && !String.Equals(ev.Source, parts.Last()) && parts.All(p => p.IsValidIdentifier()))
data.Add("SourceShortName", parts.Last());
}
object temp;
string level = ev.Data.TryGetValue(Event.KnownDataKeys.Level, out temp) ? temp as string : null;
if (!String.IsNullOrWhiteSpace(level))
data.Add("Level", level.Trim());
return new SummaryData { TemplateKey = "event-log-summary", Data = data };
}
示例8: GetHeartbeatAsync
private async Task<HeartbeatResult> GetHeartbeatAsync(PersistentEvent sessionStart) {
string sessionId = sessionStart.GetSessionId();
if (!String.IsNullOrWhiteSpace(sessionId)) {
var result = await GetLastHeartbeatActivityUtcAsync($"project:{sessionStart.ProjectId}:heartbeat:{sessionId.ToSHA1()}");
if (result != null)
return result;
}
var user = sessionStart.GetUserIdentity();
if (String.IsNullOrWhiteSpace(user?.Identity))
return null;
return await GetLastHeartbeatActivityUtcAsync($"project:{sessionStart.ProjectId}:heartbeat:{user.Identity.ToSHA1()}");
}