/// <summary> /// Checks to see if a Business Object exists without a suffix. /// </summary> /// <param name="suffix">The Suffix</param> /// <param name="length"></param> /// <returns></returns> public bool BusinessClassNameExists(string suffix, int length) { if (!BusinessClassName.EndsWith(suffix, true, CultureInfo.InvariantCulture)) { return(false); } if (Entity.Name == BusinessClassName.Substring(0, BusinessClassName.Length - length)) { return(BusinessObjectExists(String.Empty)); } return(BusinessObjectExists(BusinessClassName.Substring(BusinessClassName.Length - length, length))); }
/// <summary> /// Attempts to resolve the best canidate for the child class name. /// </summary> /// <returns></returns> private string ResolveChildBusinessClassName() { if (String.IsNullOrEmpty(BusinessClassName)) { return(BusinessClassName); } if (BusinessClassName.Equals(Entity.Name, StringComparison.InvariantCultureIgnoreCase)) { return(BusinessClassName); } if (BusinessClassNameExists("ListList", 4)) { return(BusinessClassName.Substring(0, BusinessClassName.Length - 4)); } if (BusinessClassNameExists("InfoList", 8)) { return(BusinessClassName.Substring(0, BusinessClassName.Length - 8)); } if (BusinessClassNameExists("NameValueList", 13)) { return(BusinessClassName.Substring(0, BusinessClassName.Length - 13)); } if (BusinessClassNameExists("List", 4)) { return(BusinessClassName.Substring(0, BusinessClassName.Length - 4)); } if (BusinessClassNameExists("Info", 4)) { return(BusinessClassName.Substring(0, BusinessClassName.Length - 4)); } if (BusinessClassNameExists("Criteria", 8)) { return(BusinessClassName.Substring(0, BusinessClassName.Length - 8)); } return(ResolveTargetClassName(BusinessClassName, String.Empty)); }