- Aaron D'Hooghe
- SnapObjects
- Tuesday, 17 October 2023 08:00 AM UTC
Hello,
I am using the SqlModelMapper of snapobject to retrieve/create/update/delete records in my database. My database is a sybase sql anywhere 17 using a odbc connection.
The retrieve/create/delete methodes work just fine, but the update (TrackUpdate) doesn't seem to work. When i open the profiler on my database, no update statement is received when i execute the TrackUpdate() methode. Only a commit statement is received but no acual update statement. When i use the TrackCreate() or TrackDelete() methode the database does recieve a insert and delete statement.
If i look at the output window, it just says "Database transaction has been committed".
Is it possible that the TrackUpdate methode doesn't work, or does it nog work with odbc?
This is my update methode:
public async Task<int> UpdateProductAsync(Product product)
{
_dataContext.SqlModelMapper.TrackUpdate(product);
return (await _dataContext.SqlModelMapper.SaveChangesAsync()).ModifiedCount;
}
This is my product class:
[FromTable("products", Schema = "dba")]
[SqlOrderBy("product_id")]
public class DosDossier
{
[Key]
[SqlColumn("product_id")]
public int Id { get; set; }
[SqlColumn("product_nbr ")]
public decimal ProductNbr { get; set; }
[SqlColumn(product_name ")]
public string ProductName { get; set; }
}
Kind regards.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.