Method UpdateRecords
- Namespace
- YndigoBlue.Velocity.Engine
- Assembly
- YndigoBlue.Velocity.dll
UpdateRecords(Update)
Updates one or more records in a table based on specified criteria.
public void UpdateRecords(Update update)
Parameters
Examples
using (var m = new Manager(conn))
{
var schema = m.LoadSchema("app");
var usersTable = schema["users"];
// Create an update operation
var update = new Update(usersTable);
update.SetFieldDateTime("last_login", DateTime.Now);
update.AddWhereClause(new Criterion<string>(usersTable["email"], "john@example.com"));
m.UpdateRecords(update);
Console.WriteLine("User updated");
}
Exceptions
- DbException
Thrown when a database error occurs.