public Field[] Issues { get; set; }
public bool HasErrors
{
get
{
if (!HasNoIssuesHasIssues)
{
return Issues.Any(x => x.Name == "Errors");
}
return false;
}
}
public bool HasIssues
{
get
{
return Issues != null && Issues.Length > 0;
}
}
public bool HasWarnings
{
get
{
if (!HasNoIssuesHasIssues)
{
return Issues.Any(x => x.Name == "Warnings");
}
return false;
}
}
public ResponseTags[] GetErrors()
{
if (HasErrors)
{
return Issues.First(x => x.Name == "Errors").Groups.First().Warnings;
}
return new ResponseTags[0];
}
public ResponseTags[] GetWarnings()
{
if (HasWarnings)
{
return Issues.First(x => x.Name == "Warnings").Groups.First().Warnings;
}
return new ResponseTags[0];
}
// For the display functions:
// I don't understand why you only usses the first
// groups of errors and warnings, but that may be a requirement.
public string GetErrorsDisplayData()
{
var errorString = "";
if (HasErrors)
{
errorString += Issues.First(x => x.Name == "Errors")
.Groups.First()
.Errors.Aggregate("", (data, t) => data + t.Value + "\n");
}
return errorString;
}
public string GetWarningsDisplayData()
{
var warningString = "";
if (HasWarnings)
{
warningString += Issues.First(x => x.Name == "Warnings")
.Groups.First()
.Warnings.Aggregate("", (data, t) => data + t.Value + "\n");
}
return warningString;
}
public Field[] Issues { get; set; }
public bool HasErrors
{
get
{
if (!HasNoIssues)
{
return Issues.Any(x => x.Name == "Errors");
}
return false;
}
}
public bool HasIssues
{
get
{
return Issues != null && Issues.Length > 0;
}
}
public bool HasWarnings
{
get
{
if (!HasNoIssues)
{
return Issues.Any(x => x.Name == "Warnings");
}
return false;
}
}
public ResponseTags[] GetErrors()
{
if (HasErrors)
{
return Issues.First(x => x.Name == "Errors").Groups.First().Warnings;
}
return new ResponseTags[0];
}
public ResponseTags[] GetWarnings()
{
if (HasWarnings)
{
return Issues.First(x => x.Name == "Warnings").Groups.First().Warnings;
}
return new ResponseTags[0];
}
// For the display functions:
// I don't understand why you only usses the first
// groups of errors and warnings, but that may be a requirement.
public string GetErrorsDisplayData()
{
var errorString = "";
if (HasErrors)
{
errorString += Issues.First(x => x.Name == "Errors")
.Groups.First()
.Errors.Aggregate("", (data, t) => data + t.Value + "\n");
}
return errorString;
}
public string GetWarningsDisplayData()
{
var warningString = "";
if (HasWarnings)
{
warningString += Issues.First(x => x.Name == "Warnings")
.Groups.First()
.Warnings.Aggregate("", (data, t) => data + t.Value + "\n");
}
return warningString;
}
public Field[] Issues { get; set; }
public bool HasErrors
{
get
{
if (HasIssues)
{
return Issues.Any(x => x.Name == "Errors");
}
return false;
}
}
public bool HasIssues
{
get
{
return Issues != null && Issues.Length > 0;
}
}
public bool HasWarnings
{
get
{
if (HasIssues)
{
return Issues.Any(x => x.Name == "Warnings");
}
return false;
}
}
public ResponseTags[] GetErrors()
{
if (HasErrors)
{
return Issues.First(x => x.Name == "Errors").Groups.First().Warnings;
}
return new ResponseTags[0];
}
public ResponseTags[] GetWarnings()
{
if (HasWarnings)
{
return Issues.First(x => x.Name == "Warnings").Groups.First().Warnings;
}
return new ResponseTags[0];
}
// For the display functions:
// I don't understand why you only usses the first
// groups of errors and warnings, but that may be a requirement.
public string GetErrorsDisplayData()
{
var errorString = "";
if (HasErrors)
{
errorString += Issues.First(x => x.Name == "Errors")
.Groups.First()
.Errors.Aggregate("", (data, t) => data + t.Value + "\n");
}
return errorString;
}
public string GetWarningsDisplayData()
{
var warningString = "";
if (HasWarnings)
{
warningString += Issues.First(x => x.Name == "Warnings")
.Groups.First()
.Warnings.Aggregate("", (data, t) => data + t.Value + "\n");
}
return warningString;
}