private void BuildConstructor() { if (!CollectionNavigations.Any() || IsEnumeration) { return; } Add(Tab(2), string.Format("public {0}{1}()", EntityName, Settings.ContractName)); Add(Tab(2), "{"); CollectionNavigations.Each(n => { var type = Singularize(Pass.Code.Escape(n.ToEndMember.GetEntityType())); Add(Tab(3), Pass.Code.Escape(n), " = new List<", type, Settings.ContractName, ">();"); }); Add(Tab(2), "}"); }
private void BuildConstructor() { Add(Tab(2), "public ", EntityName, "()"); Add(Tab(2), "{"); Add(Tab(3), "Initialize();"); if (CollectionNavigations.Any() && !IsEnumeration) { Add(); CollectionNavigations.Each(n => { var type = Singularize(Pass.Code.Escape(n.ToEndMember.GetEntityType())); Add(Tab(3), Pass.Code.Escape(n), " = new List<", type, ">();"); }); } Add(Tab(2), "}"); }
private void AddUpdateChildren() { Navigations.Each(p => AddUpdateChild(p)); CollectionNavigations.Each(p => AddUpdateChildCollections(p)); }