Exemplo n.º 1
0
        public static CodeFile CreateFile(
            TypePair typePair, string methodCode, string methodName, Assignment assignment = default(Assignment))
        {
            var Convention = NameConventionsStorage.Mapper;

            string shortClassName = Convention.CreateUniqueMapperMethodNameWithGuid(typePair);
            string fullClassName  = $"{Convention.Namespace}.{shortClassName}";

            string classCode = StatementTemplates.Class(methodCode, Convention.Namespace, shortClassName);

            return(new CodeFile(classCode, fullClassName, methodName, typePair, assignment));
        }
        public string BuildCode()
        {
            List <string> members = new List <string>();

            IterateStatements((tm, statement) =>
            {
                string memberCode = CreateMemberCode(statement, tm);

                memberCode = memberCode.RemoveDoubleBraces();

                members.Add(memberCode);
            }
                              );
            string code = StatementTemplates.Class(members, Convention.Namespace, Convention.ClassShortName);

            return(code);
        }