protected override bool FieldCodeNameEqualsTemplateCodeName(TemplateFieldCodeGenerationMetadata field, TemplateCodeGenerationMetadata template) { if (ForceFieldNameToMatchTemplateName) { return(true); } return(base.FieldCodeNameEqualsTemplateCodeName(field, template)); }
protected virtual IEnumerable <TemplateFieldCodeGenerationMetadata> CreateTemplateFields(TemplateInfo template, ITypeNameGenerator nameGenerator) { var fields = new List <TemplateFieldCodeGenerationMetadata>(template.OwnFields.Length); foreach (var field in template.OwnFields) { var currentField = new TemplateFieldCodeGenerationMetadata(field, nameGenerator.ConvertToIdentifier(field.Name)); fields.Add(currentField); } fields.Sort((a, b) => string.Compare(a.CodeName, b.CodeName, StringComparison.Ordinal)); return(fields); }
protected virtual bool FieldCodeNameEqualsTemplateCodeName(TemplateFieldCodeGenerationMetadata field, TemplateCodeGenerationMetadata template) { return(field.CodeName.Equals(template.CodeName)); }
public virtual void FieldNamedSameAsTemplate(TemplateCodeGenerationMetadata template, TemplateFieldCodeGenerationMetadata field) { _logger.Error($"{template.Path} ({template.Id})"); _logger.Error($"The field {field.Name} has the same name as its template. This is an architecture smell, please rename it."); }