public void CreateProperty(StringBuilder sb, string name, IWriterPropertyInfo info) { if (this.compareProperties(info)) { sb.AppendLine($" Assert.Equal(expected.{name}, actual.{name});"); } }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { if (prop.MaxLength.HasValue) { sb.AppendLine(GetMaxLength(prop.MaxLength.Value, GetMaxLengthError(name, prop.MaxLength.Value), spaces)); } base.BuildAttributes(sb, name, prop, spaces); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { if (prop.ShowOnQueryUi) { sb.AppendLine(Get(spaces)); } base.BuildAttributes(sb, name, prop, spaces); }
public static String CreateQueryNullable(IWriterPropertyInfo info) { if (info.ClrType.EndsWith("?")) //Already nullable { return(String.Empty); } return(info.IsValueType && !info.IsRequiredInQuery ? "?" : String.Empty); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { if (!String.IsNullOrEmpty(prop.DisplayName)) { sb.AppendLine(GetDisplay(prop.DisplayName, spaces)); } base.BuildAttributes(sb, name, prop, spaces); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { if (prop.Order != null) { sb.AppendLine(GetOrder(prop.Order.Value, spaces)); } base.BuildAttributes(sb, name, prop, spaces); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { if (prop.IsRequiredInQuery) { sb.AppendLine(GetRequired(GetRequiredError(name), spaces)); } base.BuildAttributes(sb, name, prop, spaces); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { if (prop.UiType != null) { sb.AppendLine($"{spaces}{prop.UiType.CreateAttribute()}"); } base.BuildAttributes(sb, name, prop, spaces); }
public virtual void CreateProperty(StringBuilder sb, String name, IWriterPropertyInfo info) { if (WriteProperties) { PropAttrBuilder.BuildAttributes(sb, name, info, " "); sb.AppendLine($" public {GetInheritance()}{info.ClrType} {name} {{ get; set; }}"); sb.AppendLine(); } }
public override void CreateProperty(StringBuilder sb, String name, IWriterPropertyInfo info) { if (allowAttributes) { attributeBuilder.BuildAttributes(sb, name, info, " "); } sb.AppendLine($" {visibility}{info.ClrType}{CreateQueryNullable(info)} {name} {{ get; set; }}"); sb.AppendLine(); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { var valueProviderType = prop.ValueProviderType; if (!String.IsNullOrEmpty(valueProviderType)) { sb.AppendLine(GetAttr(valueProviderType, spaces)); } base.BuildAttributes(sb, name, prop, spaces); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { var nullValue = prop.NullValueLabel; if (!String.IsNullOrEmpty(nullValue)) { sb.AppendLine(GetAttr(nullValue, spaces)); } base.BuildAttributes(sb, name, prop, spaces); }
public override void CreateProperty(StringBuilder sb, String name, IWriterPropertyInfo info) { sb.AppendLine( $@" public {info.ClrType}{QueryPropertiesWriter.CreateQueryNullable(info)} {name} {{ get {{ return query.{name}; }} set {{ query.{name} = value; }} }}" ); sb.AppendLine(); }
public void CreateProperty(StringBuilder sb, string name, IWriterPropertyInfo info) { switch (info.ClrType.ToLowerInvariant()) { case "string": sb.AppendLine($" {name} = {name} != null ? {name} : $\"{name} {{seed}}\","); break; default: sb.AppendLine($" {name} = {name},"); break; } }
public override void CreateProperty(StringBuilder sb, String name, IWriterPropertyInfo info) { if (info.IsRequiredInQuery) { sb.AppendLine($@" queryString.AppendItem(""{NameGenerator.CreateCamel(name)}"", {name}.ToString());"); } else { sb.AppendLine( $@" if ({name} != null) {{ queryString.AppendItem(""{NameGenerator.CreateCamel(name)}"", {name}.ToString()); }}" ); } sb.AppendLine(); }
public override void CreateProperty(StringBuilder sb, String name, IWriterPropertyInfo info) { if (info.IsRequiredInQuery) { sb.AppendLine($" query = query.Where(i => i.{name} == {name});"); } else { sb.AppendLine( $@" if ({name} != null) {{ query = query.Where(i => i.{name} == {name}); }}" ); } sb.AppendLine(); }
public override void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { sb.Append(spaces); sb.AppendLine(attributeString); base.BuildAttributes(sb, name, prop, spaces); }
public override void CreateProperty(StringBuilder sb, string name, IWriterPropertyInfo info) { sb.Append($", {info.ClrType} {name} = default({info.ClrType})"); }
public override void CreateProperty(StringBuilder sb, string name, IWriterPropertyInfo info) { base.CreateProperty(sb, name, new MakeQueryPropertiesNullable(info)); }
public virtual void CreateProperty(StringBuilder sb, string name, IWriterPropertyInfo info) { }
public MakeQueryPropertiesNullable(IWriterPropertyInfo wrapped) { this.wrapped = wrapped; }
public virtual void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { next?.BuildAttributes(sb, name, prop, spaces); }
public void BuildAttributes(StringBuilder sb, string name, IWriterPropertyInfo prop, string spaces = " ") { }