示例#1
0
        public void Update(IDefaultEntity entity)
        {
            var type = entity.GetType();
            var id   = entity.GetId();

            if (repository.GetSingle(type, id) == null)
            {
                return;
            }

            repository.DeepUpdate(entity);
        }
示例#2
0
        public void Add(IDefaultEntity entity)
        {
            var type = entity.GetType();
            var id   = entity.GetId();

            if (repository.GetSingle(type, id) != null)
            {
                return;
            }

            repository.Add(entity);
        }