一键导入
servicestack-ormlite-usage
Uses OrmLite via the implicit Db connection and understands transaction semantics and rollback behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Uses OrmLite via the implicit Db connection and understands transaction semantics and rollback behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Designs stable, discoverable APIs using routes, metadata, and versioning conventions.
Implements authentication using ServiceStack Auth Providers and session handling.
Applies role-, permission-, and ownership-based authorization using ServiceStack idioms.
Implements AutoQuery services, custom filters, and permission-aware querying.
Designs request/response DTOs using DTO-first, message-based ServiceStack conventions.
Controls OpenAPI / metadata exposure without compromising ServiceStack-first design.
基于 SOC 职业分类
| name | servicestack-ormlite-usage |
| description | Uses OrmLite via the implicit Db connection and understands transaction semantics and rollback behavior. |
OrmLite is a lightweight Micro-ORM that maps POCOs to database tables.
[Alias], [PrimaryKey], [AutoIncrement], [Index], [Required], [StringLength].[Reference] for relationships (one-to-one, one-to-many).public class Customer
{
[AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
}
Db ConnectionIn a Service class, the Db property is automatically available and managed.
Db.Select<Customer>(), Db.SingleById<Customer>(1), Db.LoadSelect<Customer>(c => c.Name.StartsWith("A")).Db.Insert(new Customer { ... }), Db.Update(customer), Db.DeleteById<Customer>(1).using blocks for transactions.using var trans = Db.OpenTransaction();
try {
Db.Insert(obj1);
Db.Insert(obj2);
trans.Commit();
} catch (Exception) {
// trans.Rollback() is called implicitly on Dispose if Commit() wasn't called
throw;
}
[IgnoreDataMember] or discrete DTOs if necessary.[Alias] is used). Match your POCO property names to DB column names.Async variants (e.g., Db.SelectAsync, Db.InsertAsync) in high-concurrency environments.