private string GetPropertyValueAccessorMethod(PropertyInfo property) { var accessorMethod = "SingleOrDefault()"; if (property.BindedType != null) accessorMethod = string.Format("SingleOrDefault() ?? new Null{0}()", property.GetCodeType()); if (property.IsList) accessorMethod = "ToList()"; return accessorMethod; }
private static string GetParsedPropertyValue(PropertyInfo property, string variableName) { var valueToParse = variableName + ".Value"; return string.Format("string.IsNullOrEmpty({0}) ? ({1})null : {2}", valueToParse, property.GetCodeType(), TypeUtils.GetParsableType(property.XmlType).ConstructParseCall(valueToParse)); }
private static string GetParsedPropertyValue(PropertyInfo property, string variableName) { var valueToParse = variableName + ".Value"; return(string.Format("string.IsNullOrEmpty({0}) ? ({1})null : {2}", valueToParse, property.GetCodeType(), TypeUtils.GetParsableType(property.XmlType).ConstructParseCall(valueToParse))); }
private string GetPropertyValueAccessorMethod(PropertyInfo property) { var accessorMethod = "SingleOrDefault()"; if (property.BindedType != null) { accessorMethod = string.Format("SingleOrDefault() ?? new Null{0}()", property.GetCodeType()); } if (property.IsList) { accessorMethod = "ToList()"; } return(accessorMethod); }