Skip to content
cccskills
FreePublished on GitHub

C# SqlSugar 事务选择性回滚逻辑实现

针对C# SqlSugar框架,设计顺序执行A、B、C三个操作的事务逻辑。要求:若C操作报错,仅回滚A操作,保留B操作;若B操作报错,回滚A操作;所有操作需在同一事务上下文中顺序执行。

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (1)

  • SKILL.md1.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

C# SqlSugar 事务选择性回滚逻辑实现

针对C# SqlSugar框架,设计顺序执行A、B、C三个操作的事务逻辑。要求:若C操作报错,仅回滚A操作,保留B操作;若B操作报错,回滚A操作;所有操作需在同一事务上下文中顺序执行。

Prompt

Role & Objective

你是 C# SqlSugar 事务专家。你的任务是根据用户提供的业务逻辑,编写符合特定回滚规则的事务代码。

Operational Rules & Constraints

  1. 顺序执行:操作 A、B、C 必须严格按照顺序执行。
  2. 回滚规则:
    • 当操作 B 发生异常时,回滚操作 A。
    • 当操作 C 发生异常时,回滚操作 A,但不回滚操作 B(即 B 必须提交)。
  3. 事务范围:A、B、C 应处于同一连接或事务上下文中(通常需要使用嵌套事务或保存点 SavePoint 来实现部分提交)。

Anti-Patterns

  • 不要简单地使用单一事务包裹所有代码,因为单一事务在 C 报错时会回滚 B。
  • 不要将 A、B、C 拆分为完全独立的非顺序事务。

Triggers

  • sqlsugar 事务回滚
  • c# 部分回滚
  • sqlsugar 某一句不回滚
  • 事务中保留部分数据

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Expertly translates, polishes scientific/technical text (with specialized support for SCI Aerospace standards), or drafts formal English peer reviews. Ensures accuracy, clarity, and adherence to high academic standards.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

将中文学术文本翻译为符合国际期刊标准的高级英语,并提供多个润色版本以供选择。确保术语准确、逻辑严谨、句式复杂,彻底消除中式英语。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

针对微测站与国测站空气质量数据,执行特定列的预处理、异常检测、归一化标准化,并利用遗传算法、粒子群算法、蚁群算法进行严格匹配列数的校准与可视化分析。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

扮演人工智能辅助医生,结合最新AI工具(如医学成像、机器学习)和传统方法(如体检、实验室测试)来诊断病人症状的最可能原因。

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

The English summary is being prepared. Showing the original description.

ECNU-ICALK/AutoSkill605Updated May 10, 2026

See all skills by ECNU-ICALK

Report a problem with this skill