public override string ToString() { var sb = new StringBuilder(); if (RowKey.Equals(TABLE_VERSION_ROW)) { sb.Append("VersionRow [").Append(DeploymentId); sb.Append(" Deployment=").Append(DeploymentId); sb.Append(" MembershipVersion=").Append(MembershipVersion); sb.Append("]"); } else { sb.Append("OrleansSilo ["); sb.Append(" Deployment=").Append(DeploymentId); sb.Append(" LocalEndpoint=").Append(Address); sb.Append(" LocalPort=").Append(Port); sb.Append(" Generation=").Append(Generation); sb.Append(" Host=").Append(HostName); sb.Append(" Status=").Append(Status); sb.Append(" ProxyPort=").Append(ProxyPort); sb.Append(" Primary=").Append(Primary); if (!string.IsNullOrEmpty(RoleName)) { sb.Append(" RoleName=").Append(RoleName); } sb.Append(" Instance=").Append(InstanceName); sb.Append(" UpgradeZone=").Append(UpdateZone); sb.Append(" FaultZone=").Append(FaultZone); if (!string.IsNullOrEmpty(SuspectingSilos)) { sb.Append(" SuspectingSilos=").Append(SuspectingSilos); } if (!string.IsNullOrEmpty(SuspectingTimes)) { sb.Append(" SuspectingTimes=").Append(SuspectingTimes); } sb.Append(" StartTime=").Append(StartTime); sb.Append(" IAmAliveTime=").Append(IAmAliveTime); sb.Append("]"); } return(sb.ToString()); }
private string GetKey(TItem item) { if (RowKey != null && RowKey.Equals("")) { throw new ArgumentException($"An empty {nameof(RowKey)} is not supported."); } if (RowKeyFunction != null) { return(RowKeyFunction(item)); } if (!string.IsNullOrEmpty(RowKey)) { return(item.GetType().GetProperty(RowKey)?.GetValue(item).ToString()); } return(null); }