Not an actual issue, just a question -
I had a query like this:
public async Task Update(string description, int id) {
var param = new {
description,
id
};
await db.ExecuteAsync("UPDATE myTable SET description = :description where id = :id", param);
}
DB type of description is nclob, it worked fine until I hit the point, where description length > 4000.
So I changed it like this:
public async Task Update(string description, int id) {
var param = new OracleDynamicParameters();
param.Add("description", description,OracleMappingType.NClob);
param.Add("id", id);
await db.ExecuteAsync("UPDATE myTable SET description = :description where id = :id", param);
}
And this works.
Question: If I have a situation, where I need to pass an argument as a NClob - is this the only way to achieve it?
Or is there a way to set the type of an argument using anonymous object like
var param = new {
description = new OracleParam(description, OracleMappingType.NClob), // Something like this, I just imagined this line here
id
};
...
It would reduce the amount of lines that I would need to refactor.