is it possible to load a sqlselect from a model without params?
I have this structure:
[SqlParameter(name: "first", dataType: typeof(int))]
[SqlParameter(name: "second", dataType: typeof(int))]
[FromTable("mytable", Schema = "DBA")]
[SqlWhere("first = :first")]
[SqlAndWhere ("second = :second")]
public class MyClass
{
[Key]
[SqlColumn("first")]
public int First { get; set; }
[Key]
[SqlColumn("second")]
public string Second { get; set; }
...
}
and my service:
var builder = ModelSqlBuilder.GetBuilder<MyClass>(_dataContext)
.GetQueryBuilder(sqlselect);
builder.RemoveWhere();
List<MyClass> result = (await _dataContext.SqlExecutor.SelectAsync<MyClass>(
builder,
new object[] { },
default)).ToList();
but it shows me:
Missing parameter value(s).
How can i dynmacilly remove the params?