I have the following class. Note there are some key values which are not shown:
namespace Storage.Models
{
public abstract class AuditableTable
{
public string Title { get; set; }
public string Text { get; set; }
}
}
I would like to store the length of the Text property in a variable called TextLength. Is it possible for me to do this automatically when an instance of the class is created or when the class is updated?
You don’t necessarily need a property, unless you want to record the initial value:
However, if you do want to record the initial length, you can do: