Assuming I have an application that allows customers to add/update products into my database over Web API. I have lightweight DTOs like this:
public class ProductDTO
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
}
What is the industry practice to track entities, assuming I would want to store the changes into an Audit table. E.g., display old price vs new price
Upon receiving the DTO in my WebAPI controller, do I have to query from the database the current record, do an object comparison, and save the differences? - Is this the only way?