Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public IPocoMeta GetMeta(IPocoId id) {
     return MetaStore.Get(id);
 }
Exemplo n.º 4
0
 public CollectionRemoval(IPocoId collectionId, object value) {
     CollectionId = collectionId;
     Value = value;
 }
Exemplo n.º 5
0
 public CollectionAddition(IPocoId collectionId, object value) {
     CollectionId = collectionId;
     Value = value;
 }
Exemplo n.º 6
0
 public IPocoMeta GetWritable(IPocoId id) {
     return Get(id);
 }
Exemplo n.º 7
0
 public PocoMeta(IPocoId id, Type type) {
     Id = id;
     Type = type;
     Properties = new Dictionary<IProperty, object>();
     Collection = new List<object>();
 }