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