Beispiel #1
0
        private static void HandleFieldLevelAttributes(PropertyInfo member, MemberDeclaration memberDeclaration)
        {
            var customAtributes = member.GetCustomAttributes();

            foreach (var attribute in customAtributes)
            {
                memberDeclaration.HandleAttributes(attribute);
            }
        }
Beispiel #2
0
        private static void AddDependancy(MemberDeclaration declare)
        {
            var HasForeinkeyWithDeclaration = declare.IsForignKey && MemberDeclarationList.ContainsKey(declare.foreignKeyEntity);

            if (HasForeinkeyWithDeclaration)
            {
                var dep = MemberDeclarationList[declare.foreignKeyEntity].First(x => x.IsPrimaryKey == true);
                dep.Dependancies.Add(declare.EnityType, declare.MemberInfo);
            }
        }
Beispiel #3
0
        private static void AddDecaration(Type item)
        {
            var members           = item.GetProperties();
            var memberDesclations = new List <MemberDeclaration>();

            foreach (var member in members)
            {
                var memberDeclaration = new MemberDeclaration();
                memberDeclaration.EnityType  = item;
                memberDeclaration.MemberInfo = member;
                memberDeclaration.MemberName = member.Name;
                HandleFieldLevelAttributes(member, memberDeclaration);

                memberDesclations.Add(memberDeclaration);
            }
            MemberDeclarationList.Add(item, memberDesclations);
        }