Skip to content

DapperAid.DataAnnotations

hnx8 edited this page Sep 27, 2024 · 3 revisions

InsertValueAttribute

指定カラムのInsert値SQL生成内容をカスタマイズする属性です。

public class DapperAid.DataAnnotations.InsertValueAttribute
    : Attribute, _Attribute

Properties

Type Name Summary
Boolean RetrieveInsertedId Insert時にこのカラムに採番されたIDを取得する場合、trueを指定します
Boolean SetValue このカラムについてのInsert列指定を生成するか否か
String Sql 設定値を直接指定する場合、設定値のSQL

SelectSqlAttribute

SelectSQL生成内容をカスタマイズする属性です。

public class DapperAid.DataAnnotations.SelectSqlAttribute
    : Attribute, _Attribute

Properties

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を指定します。

UpdateValueAttribute

指定カラムのUpdate値SQL生成内容をカスタマイズする属性です。

public class DapperAid.DataAnnotations.UpdateValueAttribute
    : Attribute, _Attribute

Properties

Type Name Summary
Boolean SetValue このカラムについてのUpdate Set句を生成するか否か
String Sql 更新値を直接指定する場合、更新値のSQL

Clone this wiki locally