public IPocoMeta Get(IPocoId id) { if (!_lock.TryEnterReadLock(TimeSpan.FromMilliseconds(100))) throw new ApplicationException("Could not enter read lock"); try { return Metas.ContainsKey(id) ? Metas[id] : null; } finally { _lock.ExitReadLock(); } }
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); }
public IPocoMeta GetMeta(IPocoId id) { return MetaStore.Get(id); }
public CollectionRemoval(IPocoId collectionId, object value) { CollectionId = collectionId; Value = value; }
public CollectionAddition(IPocoId collectionId, object value) { CollectionId = collectionId; Value = value; }
public IPocoMeta GetWritable(IPocoId id) { return Get(id); }
public PocoMeta(IPocoId id, Type type) { Id = id; Type = type; Properties = new Dictionary<IProperty, object>(); Collection = new List<object>(); }