Beispiel #1
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write(" \r\nusing System;\r\nusing System.Linq;\r\nusing System.Collections.Generic;\r\n\r\n\r\nusin" +
                       "g Blueprint41;\r\nusing Blueprint41.Core;\r\nusing Blueprint41.Query;\r\nusing Bluepri" +
                       "nt41.DatastoreTemplates;\r\nusing q = ");

            #line 20 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Settings.FullQueryNamespace));

            #line default
            #line hidden
            this.Write(";\r\n\r\nnamespace ");

            #line 22 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Settings.FullCRUDNamespace));

            #line default
            #line hidden
            this.Write("\r\n{\r\n");

            #line 24 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

            if (DALModel.IsAbstract)
            {
            #line default
            #line hidden
                this.Write("\tpublic interface I");

            #line 28 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("OriginalData");

            #line 28 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Inherits == null ? "" : string.Concat(" : I", DALModel.Inherits.Name, "OriginalData")));

            #line default
            #line hidden
                this.Write("\r\n\t{\r\n");

            #line 30 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                foreach (Property attr in DALModel.Properties)
                {
                    if (attr.IsKey)
                    {
            #line default
            #line hidden
                        this.Write("\t\t");

            #line 36 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnTypeReadOnly));

            #line default
            #line hidden
                        this.Write(" ");

            #line 36 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write(" { get; }\r\n");

            #line 37 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    }
                    else if (attr.PropertyType == PropertyType.Collection || attr.IsNodeType)
                    {
            #line default
            #line hidden
                        this.Write("\t\t");

            #line 42 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnTypeReadOnly));

            #line default
            #line hidden
                        this.Write(" ");

            #line 42 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write(" { get; }\r\n");

            #line 43 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                        if (attr.EntityReturnType != null && attr.EntityReturnType.IsAbstract)
                        {
                            foreach (Entity concrete in attr.EntityReturnType.GetSubclasses())
                            {
                                string concreteOuterType = string.Concat("IEnumerable<", concrete.ClassName, ">");


            #line default
            #line hidden
                                this.Write("\t\t");

            #line 50 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(concreteOuterType));

            #line default
            #line hidden
                                this.Write(" ");

            #line 50 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                                this.Write("_");

            #line 50 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(concrete.Name));

            #line default
            #line hidden
                                this.Write(" { get; }\r\n");

            #line 51 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            }
                        }
                    }
                    else if (attr.PropertyType == PropertyType.Lookup)
                    {
                        if (attr.Relationship.IsTimeDependent)
                        {
            #line default
            #line hidden
                            this.Write("\t\t");

            #line 60 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnTypeReadOnly));

            #line default
            #line hidden
                            this.Write(" ");

            #line 60 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                            this.Write(" { get; }\r\n");

            #line 61 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        }
                        else
                        {
            #line default
            #line hidden
                            this.Write("\t\t");

            #line 66 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnTypeReadOnly));

            #line default
            #line hidden
                            this.Write(" ");

            #line 66 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                            this.Write(" { get; }\r\n");

            #line 67 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        }
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write("\t\t");

            #line 73 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnTypeReadOnly));

            #line default
            #line hidden
                        this.Write(" ");

            #line 73 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write(" { get; }\r\n");

            #line 74 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    }
                }

                if (!string.IsNullOrEmpty(DALModel.UnidentifiedProperties))
                {
            #line default
            #line hidden
                    this.Write("\t\t\r\n\t\t#region Member for UnidentifiedProperties\r\n\r\n\t\tIDictionary<string, object> " +
                               "");

            #line 84 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.UnidentifiedProperties));

            #line default
            #line hidden
                    this.Write(" { get; }\r\n\r\n\t\t#endregion\r\n");

            #line 87 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                }


            #line default
            #line hidden
                this.Write("\t}\r\n\r\n\tpublic partial interface ");

            #line 92 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write(" : OGM");

            #line 92 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(string.Join("", DALModel.GetBaseTypes().Where(item => item.IsAbstract).Select(item => string.Concat(", ", item.ClassName)).ToArray())));

            #line default
            #line hidden
                this.Write("\r\n\t{\r\n");

            #line 94 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                if ((object)DALModel.NodeType == null && DALModel.GetBaseTypes().Count == 0)
                {
            #line default
            #line hidden
                    this.Write("\t\tstring ");

            #line 98 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.NodeTypeName));

            #line default
            #line hidden
                    this.Write(" { get; }\r\n");

            #line 99 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                }

                foreach (Property attr in DALModel.Properties)
                {
                    if (attr.PropertyType == PropertyType.Collection || attr.IsNodeType)
                    {
            #line default
            #line hidden
                        this.Write("\t\t");

            #line 107 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnType));

            #line default
            #line hidden
                        this.Write(" ");

            #line 107 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write(" { get; }\r\n");

            #line 108 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    }
                    else
                    {
                        string accessors = (attr.HideSetter) ? "get;" : "get; set;";


            #line default
            #line hidden
                        this.Write("\t\t");

            #line 114 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnType));

            #line default
            #line hidden
                        this.Write(" ");

            #line 114 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write(" { ");

            #line 114 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(accessors));

            #line default
            #line hidden
                        this.Write(" }\r\n");

            #line 115 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                        if (attr.PropertyType == PropertyType.Lookup && attr.Relationship.IsTimeDependent)
                        {
            #line default
            #line hidden
                            this.Write("\t\t");

            #line 119 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnType));

            #line default
            #line hidden
                            this.Write(" Get");

            #line 119 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                            this.Write("(DateTime? moment = null);\r\n\t\tvoid Set");

            #line 120 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                            this.Write("(");

            #line 120 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attr.OuterReturnType));

            #line default
            #line hidden
                            this.Write(" value, DateTime? moment = null);\r\n");

            #line 121 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        }
                    }
                }

                if (!string.IsNullOrEmpty(DALModel.UnidentifiedProperties))
                {
            #line default
            #line hidden
                    this.Write("\t\t\r\n\t\t#region Member for UnidentifiedProperties\r\n\r\n\t\tIDictionary<string, object> " +
                               "");

            #line 132 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.UnidentifiedProperties));

            #line default
            #line hidden
                    this.Write(" { get; }\r\n\r\n\t\t#endregion\r\n");

            #line 135 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n\t\t");

            #line 139 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Inherits == null ? "" : "new "));

            #line default
            #line hidden
                this.Write("I");

            #line 139 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("OriginalData OriginalVersion { get; }\r\n\t}\r\n\r\n\tpublic partial class ");

            #line 142 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write(" : OGMAbstractImpl<");

            #line 142 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write(", ");

            #line 142 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write(", ");

            #line 142 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.SystemReturnType));

            #line default
            #line hidden
                this.Write(">\r\n\t{\r\n\t\t#region Initialize\r\n\r\n\t\tstatic ");

            #line 146 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("()\r\n\t\t{\r\n\t\t\tRegister.Types();\r\n\t\t}\r\n\r\n\t\tprotected override void RegisterGenerated" +
                           "StoredQueries()\r\n\t\t{\r\n");

            #line 153 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                if (!DALModel.IsVirtual)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t#region LoadByKeys\r\n\t\t\t\r\n\t\t\tRegisterQuery(nameof(LoadByKeys), (query, alias) =" +
                               "> query.\r\n\t\t\t\tWhere(alias.");

            #line 160 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.Name));

            #line default
            #line hidden
                    this.Write(".In(Parameter.New<");

            #line 160 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.SystemReturnType));

            #line default
            #line hidden
                    this.Write(">(Param0))));\r\n\r\n\t\t\t#endregion\r\n\r\n");

            #line 164 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                }


            #line default
            #line hidden
                this.Write("\t\t\tAdditionalGeneratedStoredQueries();\r\n\t\t}\r\n\t\tpartial void AdditionalGeneratedSt" +
                           "oredQueries();\r\n");

            #line 170 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                if (!DALModel.IsVirtual)
                {
            #line default
            #line hidden
                    this.Write("\t\t\r\n\t\tpublic static Dictionary<");

            #line 175 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.SystemReturnType));

            #line default
            #line hidden
                    this.Write(", ");

            #line 175 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                    this.Write("> LoadByKeys(IEnumerable<");

            #line 175 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.SystemReturnType));

            #line default
            #line hidden
                    this.Write("> ");

            #line 175 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.Name.ToPlural().ToCamelCase()));

            #line default
            #line hidden
                    this.Write(")\r\n\t\t{\r\n\t\t\treturn FromQuery(nameof(LoadByKeys), new Parameter(Param0, ");

            #line 177 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.Name.ToPlural().ToCamelCase()));

            #line default
            #line hidden
                    this.Write(".ToArray(), typeof(");

            #line 177 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.SystemReturnType));

            #line default
            #line hidden
                    this.Write("))).ToDictionary(item=> item.");

            #line 177 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Key.Name));

            #line default
            #line hidden
                    this.Write(", item => item);\r\n\t\t}\r\n\r\n\t\tprotected static void RegisterQuery(string name, Func<" +
                               "IMatchQuery, q.");

            #line 180 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                    this.Write("Alias, IWhereQuery> query)\r\n\t\t{\r\n\t\t\tq.");

            #line 182 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                    this.Write("Alias alias;\r\n\r\n\t\t\tIMatchQuery matchQuery = Blueprint41.Transaction.CompiledQuery" +
                               ".Match(q.Node.");

            #line 184 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                    this.Write(".Alias(out alias));\r\n\t\t\tIWhereQuery partial = query.Invoke(matchQuery, alias);\r\n\t" +
                               "\t\tICompiled compiled = partial.Return(alias).Compile();\r\n\r\n\t\t\tRegisterQuery(name" +
                               ", compiled);\r\n\t\t}\r\n");

            #line 190 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n\t\t#endregion\r\n\r\n\t\tprivate static ");

            #line 196 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write("Members members = null;\r\n\t\tpublic static ");

            #line 197 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write("Members Members\r\n\t\t{\r\n\t\t\tget\r\n\t\t\t{\r\n\t\t\t\tif (members == null)\r\n\t\t\t\t{\r\n\t\t\t\t\tlock (t" +
                           "ypeof(");

            #line 203 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write("))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (members == null)\r\n\t\t\t\t\t\t\tmembers = new ");

            #line 206 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write("Members();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn members;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpublic class ");

            #line 212 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write("Members\r\n\t\t{\r\n\t\t\tinternal ");

            #line 214 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write("Members() { }\r\n\r\n");

            #line 216 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                foreach (Entity inherited in DALModel.GetBaseTypesAndSelf())
                {
            #line default
            #line hidden
                    this.Write("\t\t\t#region Members for interface I");

            #line 220 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(inherited.Name));

            #line default
            #line hidden
                    this.Write("\r\n\r\n");

            #line 222 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                    foreach (Property attr in inherited.Properties)
                    {
            #line default
            #line hidden
                        this.Write("\t\t\tpublic Property ");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write(" { get; } = ");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(Datastore.GetType().FullName));

            #line default
            #line hidden
                        this.Write(".Model.Entities[\"");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(inherited.Name));

            #line default
            #line hidden
                        this.Write("\"].Properties[\"");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write("\"];\r\n");

            #line 227 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    }


            #line default
            #line hidden
                    this.Write("\t\t\t#endregion\r\n\r\n");

            #line 232 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                }


            #line default
            #line hidden
                this.Write("\t\t}\r\n");

            #line 236 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                var enumProperties = DALModel.Properties.Where(item => item.EnumValues != null).ToList();

                if (enumProperties.Count != 0)
                {
            #line default
            #line hidden
                    this.Write("\r\n\t\t#region Enumerations\r\n\r\n");

            #line 245 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                    foreach (Property attr in enumProperties)
                    {
                        if (attr.EnumValues == null)
                        {
                            continue;
                        }


            #line default
            #line hidden
                        this.Write("\t\tpublic enum ");

            #line 251 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attr.Name));

            #line default
            #line hidden
                        this.Write("Enum\r\n\t\t{\r\n");

            #line 253 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"

                        foreach (var value in attr.EnumValues)
                        {
            #line default
            #line hidden
                            this.Write("\t\t\t");

            #line 257 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(value.Name));

            #line default
            #line hidden
                            this.Write(" = ");

            #line 257 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(value.Value));

            #line default
            #line hidden
                            this.Write(",\r\n");

            #line 258 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                        }


            #line default
            #line hidden
                        this.Write("\t\t}\r\n\r\n");

            #line 263 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                    }


            #line default
            #line hidden
                    this.Write("\t\t#endregion\r\n");

            #line 267 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n\t\tsealed public override Entity GetEntity()\r\n\t\t{\r\n\t\t\tif (entity == null)\r\n\t\t\t{\r" +
                           "\n\t\t\t\tlock (typeof(");

            #line 275 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.ClassName));

            #line default
            #line hidden
                this.Write("))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (entity == null)\r\n\t\t\t\t\t\tentity = ");

            #line 278 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Datastore.GetType().FullName));

            #line default
            #line hidden
                this.Write(".Model.Entities[\"");

            #line 278 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("\"];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn entity;\r\n\t\t}\r\n\t}\r\n");

            #line 284 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Entity_Abstract.tt"
            }


            #line default
            #line hidden
            this.Write("}\r\n");
            return(this.GenerationEnvironment.ToString());
        }
Beispiel #2
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write("using System;\r\nusing System.Collections.Generic;\r\n\r\nusing Blueprint41;\r\nusing Blu" +
                       "eprint41.Core;\r\nusing Blueprint41.Neo4j.Model;\r\nusing Blueprint41.Query;\r\n\r\nname" +
                       "space ");

            #line 14 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Settings.FullQueryNamespace));

            #line default
            #line hidden
            this.Write("\r\n{\r\n\tpublic partial class Node\r\n\t{\r\n");

            #line 18 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

            Entity inheritedUnidentifiedProp = DALModel.InheritedUnidentifiedProperties();
            if (DALModel.IsVirtual)
            {
            #line default
            #line hidden
                this.Write("\t\t[Obsolete(\"This entity is virtual, consider making entity ");

            #line 23 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write(" concrete or use another entity as your starting point.\", true)]\r\n");

            #line 24 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }


            #line default
            #line hidden
            this.Write("\t\tpublic static ");

            #line 27 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node ");

            #line 27 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write(" { get { return new ");

            #line 27 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node(); } }\r\n\t}\r\n\r\n\tpublic partial class ");

            #line 30 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node : Blueprint41.Query.Node\r\n\t{\r\n\t\tprotected override string GetNeo4jLabel()\r\n\t" +
                       "\t{\r\n");

            #line 34 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

            if (DALModel.IsVirtual)
            {
            #line default
            #line hidden
                this.Write("\t\t\treturn null;\r\n");

            #line 39 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }
            else
            {
            #line default
            #line hidden
                this.Write("\t\t\treturn \"");

            #line 44 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Label.Name));

            #line default
            #line hidden
                this.Write("\";\r\n");

            #line 45 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }


            #line default
            #line hidden
            this.Write("\t\t}\r\n\r\n\t\tinternal ");

            #line 50 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node() { }\r\n\t\tinternal ");

            #line 51 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node(");

            #line 51 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias alias, bool isReference = false)\r\n\t\t{\r\n\t\t\tNodeAlias = alias;\r\n\t\t\tIsReferenc" +
                       "e = isReference;\r\n\t\t}\r\n\t\tinternal ");

            #line 56 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node(RELATIONSHIP relationship, DirectionEnum direction, string neo4jLabel = null" +
                       ") : base(relationship, direction, neo4jLabel) { }\r\n\r\n\t\tpublic ");

            #line 58 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node Alias(out ");

            #line 58 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias alias)\r\n\t\t{\r\n\t\t\talias = new ");

            #line 60 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias(this);\r\n\t\t\tNodeAlias = alias;\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tpublic ");

            #line 64 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node Alias(out ");

            #line 64 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias alias, string name)\r\n\t\t{\r\n\t\t\talias = new ");

            #line 66 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias(this, name);\r\n\t\t\tNodeAlias = alias;\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tpublic ");

            #line 71 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node UseExistingAlias(AliasResult alias)\r\n\t\t{\r\n\t\t\tNodeAlias = alias;\r\n\t\t\treturn t" +
                       "his;\r\n\t\t}\r\n\r\n");

            #line 77 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

            foreach (Entity subclass in DALModel.GetSubclasses())
            {
            #line default
            #line hidden
                this.Write("\t\tpublic ");

            #line 81 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(subclass.Name));

            #line default
            #line hidden
                this.Write("Node CastTo");

            #line 81 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(subclass.Name));

            #line default
            #line hidden
                this.Write(@"()
		{
			if (this.Neo4jLabel == null)
				throw new InvalidOperationException(""Casting is not supported for virtual entities."");

			if (FromRelationship == null)
				throw new InvalidOperationException(""Please use the right type immediately, casting is only support after you have match through a relationship."");

			return new "            );

            #line 89 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(subclass.Name));

            #line default
            #line hidden
                this.Write("Node(FromRelationship, Direction, this.Neo4jLabel);\r\n\t\t}\r\n\r\n");

            #line 92 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }
            var inRelations  = Datastore.Relations.Where(item => DALModel.IsSelfOrSubclassOf(item.InEntity)).OrderBy(item => item.Name);
            var outRelations = Datastore.Relations.Where(item => DALModel.IsSelfOrSubclassOf(item.OutEntity)).OrderBy(item => item.Name);
            var anyRelations = Datastore.Relations.Where(item => DALModel.IsSelfOrSubclassOf(item.OutEntity) && item.InEntity == item.OutEntity).OrderBy(item => item.Name);

            if (inRelations.Any())
            {
            #line default
            #line hidden
                this.Write("\t\r\n\t\tpublic ");

            #line 101 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("In  In  { get { return new ");

            #line 101 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("In(this); } }\r\n\t\tpublic class ");

            #line 102 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("In\r\n\t\t{\r\n\t\t\tprivate ");

            #line 104 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node Parent;\r\n\t\t\tinternal ");

            #line 105 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("In(");

            #line 105 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node parent)\r\n\t\t\t{\r\n\t\t\t\tParent = parent;\r\n\t\t\t}\r\n");

            #line 109 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

                foreach (Relationship rel in inRelations)
                {
            #line default
            #line hidden
                    this.Write("\t\t\tpublic IFromIn_");

            #line 113 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write("_REL ");

            #line 113 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write(" { get { return new ");

            #line 113 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write("_REL(Parent, DirectionEnum.In); } }\r\n");

            #line 114 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n\t\t}\r\n");

            #line 119 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }

            if (outRelations.Any())
            {
            #line default
            #line hidden
                this.Write("\r\n\t\tpublic ");

            #line 126 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Out Out { get { return new ");

            #line 126 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Out(this); } }\r\n\t\tpublic class ");

            #line 127 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Out\r\n\t\t{\r\n\t\t\tprivate ");

            #line 129 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node Parent;\r\n\t\t\tinternal ");

            #line 130 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Out(");

            #line 130 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node parent)\r\n\t\t\t{\r\n\t\t\t\tParent = parent;\r\n\t\t\t}\r\n");

            #line 134 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

                foreach (Relationship rel in outRelations)
                {
            #line default
            #line hidden
                    this.Write("\t\t\tpublic IFromOut_");

            #line 138 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write("_REL ");

            #line 138 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write(" { get { return new ");

            #line 138 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write("_REL(Parent, DirectionEnum.Out); } }\r\n");

            #line 139 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                }


            #line default
            #line hidden
                this.Write("\t\t}\r\n");

            #line 143 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }

            if (anyRelations.Any())
            {
            #line default
            #line hidden
                this.Write("\r\n\t\tpublic ");

            #line 150 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Any Any { get { return new ");

            #line 150 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Any(this); } }\r\n\t\tpublic class ");

            #line 151 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Any\r\n\t\t{\r\n\t\t\tprivate ");

            #line 153 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node Parent;\r\n\t\t\tinternal ");

            #line 154 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Any(");

            #line 154 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node parent)\r\n\t\t\t{\r\n\t\t\t\tParent = parent;\r\n\t\t\t}\r\n");

            #line 158 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

                foreach (Relationship rel in anyRelations)
                {
            #line default
            #line hidden
                    this.Write("\t\t\tpublic IFromAny_");

            #line 162 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write("_REL ");

            #line 162 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write(" { get { return new ");

            #line 162 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(rel.Name));

            #line default
            #line hidden
                    this.Write("_REL(Parent, DirectionEnum.None); } }\r\n");

            #line 163 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                }


            #line default
            #line hidden
                this.Write("\t\t}\r\n");

            #line 167 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }


            #line default
            #line hidden
            this.Write("\t}\r\n\r\n\tpublic class ");

            #line 172 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias : AliasResult<");

            #line 172 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias, ");

            #line 172 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("ListAlias>\r\n\t{\r\n\t\tinternal ");

            #line 174 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias(");

            #line 174 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node parent)\r\n\t\t{\r\n\t\t\tNode = parent;\r\n\t\t}\r\n\t\tinternal ");

            #line 178 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias(");

            #line 178 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node parent, string name)\r\n\t\t{\r\n\t\t\tNode = parent;\r\n\t\t\tAliasName = name;\r\n\t\t}\r\n\r\n\t" +
                       "\tprivate  ");

            #line 184 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias(Func<QueryTranslator, string> function, object[] arguments, Type type) : ba" +
                       "se(function, arguments, type) { }\r\n\t\tprivate  ");

            #line 185 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias(FieldResult parent, Func<QueryTranslator, string> function, object[] argume" +
                       "nts = null, Type type = null) : base(parent, function, arguments, type) { }\r\n\t\tp" +
                       "rivate  ");

            #line 186 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write(@"Alias(AliasResult alias, Func<QueryTranslator, string> function, object[] arguments = null, Type type = null) : base(alias, function, arguments, type)
		{
			Node = alias.Node;
		}

		public override IReadOnlyDictionary<string, FieldResult> AliasFields
		{
			get
			{
				if (m_AliasFields == null)
				{
					m_AliasFields = "                    );

            #line 197 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(inheritedUnidentifiedProp == null ? "" : "new UnidentifiedPropertiesAliasDictionary("));

            #line default
            #line hidden
            this.Write("new Dictionary<string, FieldResult>()\r\n\t\t\t\t\t{\r\n");

            #line 199 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

            foreach (var property in DALModel.GetPropertiesOfBaseTypesAndSelf())
            {
                if (property.PropertyType != PropertyType.Attribute)
                {
                    continue;
                }


            #line default
            #line hidden
                this.Write("\t\t\t\t\t\t{ \"");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write("\", new ");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(GetResultType(property.SystemReturnType)));

            #line default
            #line hidden
                this.Write("(this, \"");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write("\", ");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Datastore.GetType().FullName));

            #line default
            #line hidden
                this.Write(".Model.Entities[\"");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("\"], ");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Datastore.GetType().FullName));

            #line default
            #line hidden
                this.Write(".Model.Entities[\"");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Parent.Name));

            #line default
            #line hidden
                this.Write("\"].Properties[\"");

            #line 205 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write("\"]) },\r\n");

            #line 206 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }


            #line default
            #line hidden
            this.Write("\t\t\t\t\t}");

            #line 209 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(inheritedUnidentifiedProp == null ? "" : string.Concat(", ", Settings.FullCRUDNamespace, ".", DALModel.Name, ".Entity, this)")));

            #line default
            #line hidden
            this.Write(";\r\n\t\t\t\t}\r\n\t\t\t\treturn m_AliasFields;\r\n\t\t\t}\r\n\t\t}\r\n\t\tprivate IReadOnlyDictionary<str" +
                       "ing, FieldResult> m_AliasFields = null;\r\n\r\n");

            #line 216 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

            if (inRelations.Any())
            {
            #line default
            #line hidden
                this.Write("\t\tpublic ");

            #line 220 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node.");

            #line 220 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("In In { get { return new ");

            #line 220 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node.");

            #line 220 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("In(new ");

            #line 220 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node(this, true)); } }\r\n");

            #line 221 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }
            if (outRelations.Any())
            {
            #line default
            #line hidden
                this.Write("\t\tpublic ");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node.");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Out Out { get { return new ");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node.");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Out(new ");

            #line 226 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node(this, true)); } }\r\n");

            #line 227 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }
            if (anyRelations.Any())
            {
            #line default
            #line hidden
                this.Write("\t\tpublic ");

            #line 232 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node.");

            #line 232 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Any Any { get { return new ");

            #line 232 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node.");

            #line 232 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Any(new ");

            #line 232 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Node(this, true)); } }\r\n");

            #line 233 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }


            #line default
            #line hidden
            this.Write("\r\n");

            #line 237 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"

            foreach (var property in DALModel.GetPropertiesOfBaseTypesAndSelf())
            {
                if (property.PropertyType != PropertyType.Attribute)
                {
                    continue;
                }



            #line default
            #line hidden
                this.Write("\t\tpublic ");

            #line 244 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(GetResultType(property.SystemReturnType)));

            #line default
            #line hidden
                this.Write(" ");

            #line 244 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write("\r\n\t\t{\r\n\t\t\tget\r\n\t\t\t{\r\n\t\t\t\tif ((object)m_");

            #line 248 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write(" == null)\r\n\t\t\t\t\tm_");

            #line 249 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write(" = (");

            #line 249 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(GetResultType(property.SystemReturnType)));

            #line default
            #line hidden
                this.Write(")AliasFields[\"");

            #line 249 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write("\"];\r\n\r\n\t\t\t\treturn m_");

            #line 251 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write(";\r\n\t\t\t}\r\n\t\t} \r\n\t\tprivate ");

            #line 254 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(GetResultType(property.SystemReturnType)));

            #line default
            #line hidden
                this.Write(" m_");

            #line 254 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

            #line default
            #line hidden
                this.Write(" = null;\r\n");

            #line 255 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }

            if (inheritedUnidentifiedProp != null)
            {
            #line default
            #line hidden
                this.Write("\t\tpublic UnidentifiedProperties ");

            #line 261 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(inheritedUnidentifiedProp.UnidentifiedProperties));

            #line default
            #line hidden
                this.Write("\r\n\t\t{\r\n\t\t\tget\r\n\t\t\t{\r\n\t\t\t\tif ((object)m_");

            #line 265 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(inheritedUnidentifiedProp.UnidentifiedProperties));

            #line default
            #line hidden
                this.Write(" == null)\r\n\t\t\t\t\tm_");

            #line 266 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(inheritedUnidentifiedProp.UnidentifiedProperties));

            #line default
            #line hidden
                this.Write(" = new UnidentifiedProperties(this, ");

            #line 266 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Datastore.GetType().FullName));

            #line default
            #line hidden
                this.Write(".Model.Entities[\"");

            #line 266 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("\"]);\r\n\r\n\t\t\t\treturn m_");

            #line 268 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(inheritedUnidentifiedProp.UnidentifiedProperties));

            #line default
            #line hidden
                this.Write(";\r\n\t\t\t}\r\n\t\t}\r\n\t\tprivate UnidentifiedProperties m_");

            #line 271 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(inheritedUnidentifiedProp.UnidentifiedProperties));

            #line default
            #line hidden
                this.Write(" = null;\r\n\r\n\t\tpublic class UnidentifiedProperties\r\n\t\t{\r\n\t\t\tinternal UnidentifiedP" +
                           "roperties(");

            #line 275 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write("Alias alias, Entity entity)\r\n\t\t\t{\r\n\t\t\t\tAlias = alias;\r\n\t\t\t\tEntity = entity;\r\n\t\t\t}" +
                           "\r\n\t\t\tprivate ");

            #line 280 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
                this.Write(@"Alias Alias;
			private Entity Entity;

			public MiscResult Get(string fieldName) { return new MiscResult(Alias, fieldName, Entity, null); }
			public MiscResult this[string fieldName] { get { return Get(fieldName); } }

			public MiscResult Get(FieldResult result, bool withCoalesce = false, Type type = null)
			{
				if (withCoalesce)
					return new MiscResult(t => t.FnGetFieldWithCoalesce, new object[] { Alias, result }, type ?? typeof(object));
				else
					return new MiscResult(t => t.FnGetField, new object[] { Alias, result }, type ?? typeof(object));
			}
		}
");

            #line 294 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            }


            #line default
            #line hidden
            this.Write("\t\tpublic AsResult As(string aliasName, out ");

            #line 297 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias alias)\r\n\t\t{\r\n\t\t\talias = new ");

            #line 299 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias((");

            #line 299 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Node)Node)\r\n\t\t\t{\r\n\t\t\t\tAliasName = aliasName\r\n\t\t\t};\r\n\t\t\treturn this.As(aliasName);" +
                       "\r\n\t\t}\r\n\t}\r\n\r\n\tpublic class ");

            #line 307 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("ListAlias : ListResult<");

            #line 307 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("ListAlias, ");

            #line 307 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("Alias>, IAliasListResult\r\n\t{\r\n\t\tprivate ");

            #line 309 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("ListAlias(Func<QueryTranslator, string> function, object[] arguments, Type type) " +
                       ": base(function, arguments, type) { }\r\n\t\tprivate ");

            #line 310 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("ListAlias(FieldResult parent, Func<QueryTranslator, string> function, object[] ar" +
                       "guments = null, Type type = null) : base(parent, function, arguments, type) { }\r" +
                       "\n\t\tprivate ");

            #line 311 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("ListAlias(AliasResult alias, Func<QueryTranslator, string> function, object[] arg" +
                       "uments = null, Type type = null) : base(alias, function, arguments, type) { }\r\n\t" +
                       "}\r\n\tpublic class ");

            #line 313 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("JaggedListAlias : ListResult<");

            #line 313 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("JaggedListAlias, ");

            #line 313 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("ListAlias>, IAliasJaggedListResult\r\n\t{\r\n\t\tprivate ");

            #line 315 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("JaggedListAlias(Func<QueryTranslator, string> function, object[] arguments, Type " +
                       "type) : base(function, arguments, type) { }\r\n\t\tprivate ");

            #line 316 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("JaggedListAlias(FieldResult parent, Func<QueryTranslator, string> function, objec" +
                       "t[] arguments = null, Type type = null) : base(parent, function, arguments, type" +
                       ") { }\r\n\t\tprivate ");

            #line 317 "C:\_CirclesArrows\blueprint41\Blueprint41\DatastoreTemplates\Domain_Data_Node.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DALModel.Name));

            #line default
            #line hidden
            this.Write("JaggedListAlias(AliasResult alias, Func<QueryTranslator, string> function, object" +
                       "[] arguments = null, Type type = null) : base(alias, function, arguments, type) " +
                       "{ }\r\n\t}\r\n}\r\n");
            return(this.GenerationEnvironment.ToString());
        }