Exemplo n.º 1
0
        public string GetNameForEntity(EntityMetadata entityMetadata)
        {
            if (this._knowNames.ContainsKey(entityMetadata.MetadataId.Value.ToString()))
            {
                return(this._knowNames[entityMetadata.MetadataId.Value.ToString()]);
            }

            string validTypeName = this.CreateValidTypeName(string.IsNullOrEmpty(StaticNamingService.GetNameForEntity(entityMetadata)) ? entityMetadata.SchemaName : StaticNamingService.GetNameForEntity(entityMetadata));

            this._knowNames.Add(entityMetadata.MetadataId.Value.ToString(), validTypeName);

            return(validTypeName);
        }
Exemplo n.º 2
0
        public string GetNameForAttribute(EntityMetadata entityMetadata, AttributeMetadata attributeMetadata)
        {
            string validName = NamingService.CreateValidName(StaticNamingService.GetNameForAttribute(attributeMetadata.LogicalName) ?? attributeMetadata.SchemaName);

            CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp");

            if (!provider.IsValidIdentifier(validName))
            {
                validName = "@" + validName;
            }

            return(validName);
        }
Exemplo n.º 3
0
 static StaticNamingService()
 {
     StaticNamingService.InitializeAtributeNames();
 }