Exemple #1
0
        public void Delete <TDocument>(string id, DeleteOptions options = null) where TDocument : class
        {
            var command = builder.PrepareDelete <TDocument>(id, options);

            configuration.Hooks.BeforeDelete <TDocument>(id, command.Mapping, this);
            ExecuteNonQuery(command);
            configuration.Hooks.AfterDelete <TDocument>(id, command.Mapping, this);
        }
        PreparedCommand PrepareDelete(DeleteOptions options)
        {
            var whereClausesList = whereClauses.ToList();

            var where = whereClausesList.Any() ? new Where(new AndClause(whereClausesList)) : new Where();

            return(queryBuilder.PrepareDelete(typeof(TRecord), where, parameterValues, options));
        }