protected void AddDescription(CodeTypeMember type, EntityDescription description)
        {
            if (String.IsNullOrWhiteSpace(description.Description))
                return;

            AddAttribute(type, "Description", description.Description);
        }
 public void SetUp()
 {
     Configuration = CodeGeneratorConfiguration.Create().DocumentTypes;
     Candidate = Type = new CodeTypeDeclaration();
     Generator = new InterfaceNameGenerator(Configuration);
     documentType = new DocumentType { Info = { Alias = "aMixin" } };
     EntityDescription = documentType.Info;
 }
 public void SetUp()
 {
     Configuration = new CodeGeneratorConfiguration().MediaTypes;
     Candidate = Type = new CodeTypeDeclaration();
     Generator = new EntityDescriptionGenerator(Configuration);
     documentType = new DocumentType { Info = { Alias = "anEntity" } };
     EntityDescription = documentType.Info;
 }
 public void SetUp()
 {
     Configuration = CodeGeneratorConfiguration.Create().MediaTypes;
     attribute = new CodeAttributeDeclaration();
     Generator = new EntityDescriptionGenerator(Configuration);
     documentType = new DocumentType { Info = { Alias = "anEntity" } };
     EntityDescription = documentType.Info;
 }
 protected static void AddDisplayNameIfDifferent(CodeTypeMember type, EntityDescription description)
 {
     var name = description.Name;
     if (String.Compare(name, description.Alias, IgnoreCase) == 0 ||
         String.Compare(name, description.Alias.SplitPascalCase(), IgnoreCase) == 0)
         return;
     AddAttribute(type, "DisplayName", name);
 }
 protected static void SetName(CodeTypeMember type, EntityDescription description)
 {
     type.Name = description.Alias.PascalCase();
 }
 protected static void ValidateAlias(EntityDescription description)
 {
     if (String.IsNullOrWhiteSpace(description.Alias))
         throw new Exception("Cannot generate entity with alias null or empty");
 }