Exemplo n.º 1
0
        public IPatchExpression <T> Patch <T>(Expression <Func <T, bool> > @where)
        {
            assertNotDisposed();

            var model = Query <T>().Where(@where).As <MartenQueryable <T> >().ToQueryModel();

            var fragment = QueryModelExtensions.BuildWhereFragment(_store, model, Tenant);

            return(new PatchExpression <T>(fragment, Tenant, _unitOfWork, _store.Serializer));
        }
Exemplo n.º 2
0
        public void DeleteWhere <T>(Expression <Func <T, bool> > expression)
        {
            assertNotDisposed();

            var model = Query <T>().Where(expression).As <MartenQueryable <T> >().ToQueryModel();

            var where = QueryModelExtensions.BuildWhereFragment(_store, model, Tenant);

            var deletion = Tenant.StorageFor(typeof(T)).DeletionForWhere(@where);

            _unitOfWork.Add(deletion);
        }