/// <summary> /// Indicates whether all of the property values of the object are valid /// </summary> /// <param name="message">If the object is not valid then this returns the reason for it being invalid</param> /// <returns>Returns true if all are valid</returns> public bool IsValid(out string message) { IList <IBOError> errors; bool isValid = IsValid(out errors); message = errors .Aggregate("", (current, error) => StringUtilities.AppendMessage(current, error.Message)); return(isValid); }
/// <summary> /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. /// </summary> /// <returns> /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. /// </returns> /// <filterpriority>2</filterpriority> public override string ToString() { string toStringValue = ""; foreach (PropDef lPropDef in this) { toStringValue = StringUtilities.AppendMessage(toStringValue, lPropDef.PropertyName, "_"); } return(toStringValue); }
private static IEnumerable <Type> GetAssemblyTypes(Assembly assembly) { try { return(assembly.GetTypes()); } catch (ReflectionTypeLoadException e) { var message = e.Message; var loaderExceptions = e.LoaderExceptions; foreach (var exception in loaderExceptions) { message = StringUtilities.AppendMessage(message, exception.Message, Environment.NewLine); } _logger.Log(message, LogCategory.Exception); throw new HabaneroApplicationException(message, e); } }
private void AppendOrderByField(StringBuilder orderByClause, OrderCriteriaField orderOrderCriteriaField) { string direction = orderOrderCriteriaField.SortDirection == SortDirection.Ascending ? "ASC" : "DESC"; string tableAndFieldName; if (orderOrderCriteriaField.Source != null) { tableAndFieldName = this.Aliases[orderOrderCriteriaField.Source.ChildSourceLeaf.ToString()] + "." + DelimitFieldName(orderOrderCriteriaField.FieldName); } else { if (Fields.ContainsKey(orderOrderCriteriaField.PropertyName)) { var queryField = Fields[orderOrderCriteriaField.PropertyName]; tableAndFieldName = String.Format("{0}{1}", queryField.Source != null ? this.Aliases[queryField.Source.ToString()] + "." : "", DelimitFieldName(queryField.FieldName)); } else { tableAndFieldName = this.Aliases[Source.ToString()] + "." + DelimitFieldName(orderOrderCriteriaField.FieldName); } } StringUtilities.AppendMessage(orderByClause, tableAndFieldName + " " + direction, ", "); }