Does NHibernate always generate update for all columns?
public class Person
{
    public virtual int Id { get; set; }
    public virtual string Name { get; set; }
    public virtual string Address { get; set; }
}
Person p = Session.Load(1);
p.Name = "New Name";
Session.Flush();//Update for all columns, but I change only Name
Is it normal behavior for NHibernate or my mistake? I use Fluent NHibernate and AutoMapping.
That is the default behavior, but you can make NH update modified columns only by adding dynamic-update="true" to your <class> mapping.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With