protected override bool FieldCodeNameEqualsTemplateCodeName(TemplateFieldCodeGenerationMetadata field, TemplateCodeGenerationMetadata template)
 {
     if (ForceFieldNameToMatchTemplateName)
     {
         return(true);
     }
     return(base.FieldCodeNameEqualsTemplateCodeName(field, template));
 }
Ejemplo n.º 2
0
        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));
 }
Ejemplo n.º 4
0
 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.");
 }