Пример #1
0
            internal LoadedChildrenEnumerator(Entity entity)
            {
                _entity = entity;

                //Entity 有可能是一个 Criteria,这时会没有仓库。
                var repo = entity.FindRepository();

                if (repo != null)
                {
                    _childProperties = repo.GetChildProperties();
                }
                else
                {
                    _childProperties = new IProperty[0];
                }
                _index   = -1;
                _current = new ChildPropertyField();
            }
Пример #2
0
            public bool MoveNext()
            {
                while (true)
                {
                    _index++;
                    if (_index >= _childProperties.Count)
                    {
                        break;
                    }

                    var property = _childProperties[_index];
                    var value    = _entity.GetProperty(property) as IDomainComponent;
                    if (value != null)
                    {
                        _current = new ChildPropertyField(property, value);
                        return(true);
                    }
                }

                return(false);
            }
Пример #3
0
            public bool MoveNext()
            {
                while (true)
                {
                    _index++;
                    if (_index >= _childProperties.Count) { break; }

                    var property = _childProperties[_index];
                    var value = _entity.GetProperty(property) as IDomainComponent;
                    if (value != null)
                    {
                        _current = new ChildPropertyField(property, value);
                        return true;
                    }
                }

                return false;
            }
Пример #4
0
            internal LoadedChildrenEnumerator(Entity entity)
            {
                _entity = entity;

                //Entity 有可能是一个 Criteria,这时会没有仓库。
                var repo = entity.FindRepository();
                if (repo != null)
                {
                    _childProperties = repo.GetChildProperties();
                }
                else
                {
                    _childProperties = new IProperty[0];
                }
                _index = -1;
                _current = new ChildPropertyField();
            }