/// <summary> /// 指定された型情報から対象となるテーブルのレコードを取得するクエリを生成します。 /// </summary> /// <typeparam name="T">テーブルの型</typeparam> /// <param name="properties">抽出する列にマッピングされるプロパティのコレクション。指定がない場合はすべての列を抽出対象とします。</param> /// <returns>生成されたSQL</returns> public static string CreateSelect <T>(Expression <Func <T, object> > properties = null) { var propertyNames = properties == null ? null : ExpressionHelper.GetMemberNames(properties); return(This.CreateSelect(typeof(T), propertyNames)); }
public static string CreateUpdate <T>(DbKind targetDatabase, bool setIdentity, params Expression <Func <T, object> >[] properties) { var propertyNames = properties == null || properties.Length == 0 ? null : ExpressionHelper.GetMemberNames(properties); return(This.CreateUpdate(targetDatabase, typeof(T), propertyNames, setIdentity)); }
public static string CreateSelect <T>(params Expression <Func <T, object> >[] properties) { var propertyNames = properties == null || properties.Length == 0 ? null : ExpressionHelper.GetMemberNames(properties); return(This.CreateSelect(typeof(T), propertyNames)); }
/// <summary> /// 指定された型情報から、対象となるテーブルのレコードを指定されたプロパティにマッピングされている列に絞って更新するクエリを生成します。 /// </summary> /// <typeparam name="T">テーブルの型</typeparam> /// <param name="targetDatabase">対象データベース</param> /// <param name="properties">抽出する列にマッピングされるプロパティのコレクション。指定がない場合はすべての列を抽出対象とします。</param> /// <param name="setIdentity">自動採番のID列に値を設定するかどうか</param> /// <returns>生成されたSQL</returns> public static string CreateUpdate <T>(DbKind targetDatabase, Expression <Func <T, object> > properties = null, bool setIdentity = false) { var propertyNames = properties == null ? null : ExpressionHelper.GetMemberNames(properties); return(This.CreateUpdate(targetDatabase, typeof(T), propertyNames, setIdentity)); }
public static string CreateUpdate(DbKind targetDatabase, Type type, bool setIdentity, params string[] propertyNames) => This.CreateUpdate(targetDatabase, type, propertyNames, setIdentity);
public static string CreateUpdate(DbKind targetDatabase, Type type, params string[] propertyNames) => This.CreateUpdate(targetDatabase, type, propertyNames, false);
public static string CreateUpdate <T>(DbKind targetDatabase, params Expression <Func <T, object> >[] properties) => This.CreateUpdate <T>(targetDatabase, false, properties);
public static string CreateSelect(Type type, params string[] propertyNames) => This.CreateSelect(type, (IEnumerable <string>)propertyNames);
/// <summary> /// 指定された型情報から対象となるテーブルのすべてのレコードを切り捨てるクエリを生成します。 /// </summary> /// <typeparam name="T">テーブルの型</typeparam> /// <returns>生成されたSQL</returns> public static string CreateTruncate <T>() => This.CreateTruncate(typeof(T));
/// <summary> /// 指定された型情報から対象となるテーブルのレコード数をカウントするクエリを生成します。 /// </summary> /// <typeparam name="T">テーブルの型</typeparam> /// <returns>生成されたSQL</returns> public static string CreateCount <T>() => This.CreateCount(typeof(T));
/// <summary> /// 指定された型情報から対象となるテーブルのすべてのレコードを削除するクエリを生成します。 /// </summary> /// <typeparam name="T">テーブルの型</typeparam> /// <returns>生成されたSQL</returns> public static string CreateDelete <T>() => This.CreateDelete(typeof(T));
/// <summary> /// 指定された型情報から対象となるテーブルにレコードを挿入するクエリを生成します。 /// </summary> /// <typeparam name="T">テーブルの型</typeparam> /// <param name="targetDatabase">対象データベース</param> /// <param name="useSequence">シーケンスを利用するかどうか</param> /// <param name="setIdentity">自動採番のID列に値を設定するかどうか</param> /// <returns>生成されたSQL</returns> public static string CreateInsert <T>(DbKind targetDatabase, bool useSequence = true, bool setIdentity = false) => This.CreateInsert(targetDatabase, typeof(T), useSequence, setIdentity);