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)); }
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); }