Beispiel #1
0
        private void FixupSection_Parent(Section previousValue)
        {
            if (previousValue != null && previousValue.Sections_Children.Contains(this))
            {
                previousValue.Sections_Children.Remove(this);
            }

            if (Section_Parent != null)
            {
                if (!Section_Parent.Sections_Children.Contains(this))
                {
                    Section_Parent.Sections_Children.Add(this);
                }
                if (Parent_Id != Section_Parent.Id)
                {
                    Parent_Id = Section_Parent.Id;
                }
            }
            else if (!_settingFK)
            {
                Parent_Id = null;
            }
        }
Beispiel #2
0
        public static Section GetEntity(this SectionPrimitive primitive)
        {
            Section result = new Section();

                result.Id = primitive.Id;

                result.Parent_Id = primitive.Parent_Id;

                result.Name = primitive.Name;

                result.Position = primitive.Position;

                result.CreateTime = primitive.CreateTime;

                result.DeleteTime = primitive.DeleteTime;

                return result;
        }