-
Notifications
You must be signed in to change notification settings - Fork 6
DapperAid.DataAnnotations
hnx8 edited this page Sep 27, 2024
·
3 revisions
指定カラムのInsert値SQL生成内容をカスタマイズする属性です。
public class DapperAid.DataAnnotations.InsertValueAttribute
: Attribute, _AttributeProperties
| Type | Name | Summary |
|---|---|---|
Boolean |
RetrieveInsertedId | Insert時にこのカラムに採番されたIDを取得する場合、trueを指定します |
Boolean |
SetValue | このカラムについてのInsert列指定を生成するか否か |
String |
Sql | 設定値を直接指定する場合、設定値のSQL |
SelectSQL生成内容をカスタマイズする属性です。
public class DapperAid.DataAnnotations.SelectSqlAttribute
: Attribute, _AttributeProperties
| Type | Name | Summary |
|---|---|---|
String |
BaseWhereClauses | SelectSQL文のWhere条件として必ず指定するSQL句(「deleted_at is null」など)があれば設定します。 |
String |
Beginning | SelectSQL文の冒頭に設定する文字列、既定では「select」。必要に応じ「select distinct」「select TOP 10」「with XXX(...) as (....) select」などを指定してください。 |
String |
DefaultOtherClauses | SelectSQL文の末尾に、otherClausesが未指定だった場合にデフォルトで付加するSQL句(orderBy条件/limit/offset指定など)があれば設定します。 |
Boolean |
GroupByKey | SelectSQL文でgroup by句を生成しKey項目のカラムでグループ化する場合、trueを指定します。 |
指定カラムのUpdate値SQL生成内容をカスタマイズする属性です。
public class DapperAid.DataAnnotations.UpdateValueAttribute
: Attribute, _AttributeProperties
| Type | Name | Summary |
|---|---|---|
Boolean |
SetValue | このカラムについてのUpdate Set句を生成するか否か |
String |
Sql | 更新値を直接指定する場合、更新値のSQL |