Ejemplo n.º 1
0
 public TEntity Get(TIdentity identity)
 {
     AssertDispatcherThread();
     return((from entity in GetAll().ToList()
             where _identifier.GetIdentity(entity).Equals(identity)
             select entity).FirstOrDefault());
 }
Ejemplo n.º 2
0
        public TEntity Store(TEntity entity)
        {
            AssertDispatcherThread();
            var identity = _identifier.GetIdentity(entity);
            var val      = _store.Get(identity);

            if (val == null)
            {
                _store.Add(entity);
            }
            return(entity);
        }
Ejemplo n.º 3
0
        public TEntity Store(TEntity entity)
        {
            AssertDispatcherThread();
            var identity = _identifier.GetIdentity(entity);
            var existing = _store.Get(identity);

            if (existing != null)
            {
                // Conflict resolution and merging
            }
            else
            {
                _store.Add(entity);
            }

            return(entity);
        }
Ejemplo n.º 4
0
 public TEntity Get(TIdentity identity)
 {
     AssertDispatcherThread();
     return(GetAll().ToList().Where(entity => _identifier.GetIdentity(entity).Equals(identity)).FirstOrDefault());
 }