Skip to content

Example.QueryBuilder.Delete

IzayoiJiichan edited this page Aug 14, 2024 · 1 revision

Examples

Delete

    {
        var queryOption = new QueryOption();

        var queryBuilder = new QueryBuilder(queryOption);

        var delete1 = new Delete()
            .SetFrom("users")
            .AddWhere("id", "=", 1);

        queryBuilder.Build(delete1);

        string query = queryBuilder.GetQuery();

        var parameters = queryBuilder.GetParameters();

        // query:
        //   DELETE
        //   FROM users
        //   WHERE id = @w_0
        // parameters:
        //   [0]:
        //     ParameterName: @w_0
        //     DbType: DbType.Int32
        //     Value: 1
    }