Пример #1
0
        public IEnumerable<object> GetPocos(IEnumerable<IPocoId> ids) {
            var metas = Server.MetaStore.Get(ids);

            var pocoProxyBuilder = new ReadOnlyPocoProxyBuilder();
            var collectionProxyBuilder = new ReadOnlyCollectionProxyBuilder();
            pocoProxyBuilder.Initialise(this);
            collectionProxyBuilder.Initialise(this);
            var pocoFactory = new PocoFactory(pocoProxyBuilder, collectionProxyBuilder);

            return metas.Select(meta => pocoFactory.Build(meta, IdsMetasAndProxies));
        }
Пример #2
0
        public object GetPoco(IPocoId id) {
            var meta = Server.MetaStore.Get(id);

            if (meta == null)
                throw new ArgumentException("id is not recognised");

            var pocoProxyBuilder = new ReadOnlyPocoProxyBuilder();
            var collectionProxyBuilder = new ReadOnlyCollectionProxyBuilder();
            pocoProxyBuilder.Initialise(this);
            collectionProxyBuilder.Initialise(this);
            var pocoFactory = new PocoFactory(pocoProxyBuilder, collectionProxyBuilder);

            return pocoFactory.Build(meta, IdsMetasAndProxies);
        }