コード例 #1
0
        public static string GetTableName(string name)
        {
            var indexOf = name.IndexOf(".", System.StringComparison.Ordinal);

            if (indexOf > -1)
            {
                name = name.Substring(indexOf + 1);
            }
            return(CodeEngine.CleanName(name));
        }
コード例 #2
0
        public List <IPersistentAttributeInfo> Create(Table table, IPersistentClassInfo owner, IMapperInfo mapperInfo)
        {
            var persistentAttributeInfos = new List <IPersistentAttributeInfo>();

            if (owner.TypeAttributes.OfType <IPersistentPersistentAttribute>().FirstOrDefault() == null)
            {
                persistentAttributeInfos.Add(GetPersistentPersistentAttribute(table.Name));
            }
            if (!(string.IsNullOrEmpty(mapperInfo.NavigationPath)) && owner.TypeAttributes.OfType <IPersistentNavigationItemAttribute>().FirstOrDefault() == null)
            {
                var persistentNavigationItemAttribute = ObjectSpace.CreateWCObject <IPersistentNavigationItemAttribute>();
                var cleanName = CodeEngine.CleanName(owner.Name);
                persistentNavigationItemAttribute.Path   = mapperInfo.NavigationPath + "/" + cleanName;
                persistentNavigationItemAttribute.ViewId = cleanName + "_ListView";
                persistentAttributeInfos.Add(persistentNavigationItemAttribute);
            }
            return(persistentAttributeInfos);
        }
コード例 #3
0
        public IEnumerable <IPersistentAttributeInfo> Create()
        {
            var persistentAttributeInfos = new List <IPersistentAttributeInfo>();

            if (_persistentClassInfo.TypeAttributes.OfType <IPersistentPersistentAttribute>().FirstOrDefault() == null)
            {
                persistentAttributeInfos.Add(GetPersistentPersistentAttribute(_dbTable.Name));
            }
            if (!(string.IsNullOrEmpty(_navigationPath)) && _persistentClassInfo.TypeAttributes.OfType <IPersistentNavigationItemAttribute>().FirstOrDefault() == null)
            {
                var persistentNavigationItemAttribute = _objectSpace.CreateWCObject <IPersistentNavigationItemAttribute>();
                var cleanName = CodeEngine.CleanName(_persistentClassInfo.Name);
                persistentNavigationItemAttribute.Path   = _navigationPath + "/" + cleanName;
                persistentNavigationItemAttribute.ViewId = cleanName + "_ListView";
                persistentAttributeInfos.Add(persistentNavigationItemAttribute);
            }
            return(persistentAttributeInfos);
        }