예제 #1
0
        public T delete(T model)
        {
            if (!policy.checkDelete(model.ID))
            {
                throw new UnauthorizedException("You do not have permission to delete this resource");
            }

            var searchParams = new DbParams(new DbParam[] {
                new DbParam("id", model.ID, this.transformer.getParamType("id")),
            });

            DB.delete(this.tableName, searchParams);

            this.afterDelete(model);

            return(model);
        }