I'm using EF, but can't add 1 to property counted
(column in SQL)
How to add counted+1 in Entity Framework?
Like in
SQL
update cars
set counted = counted + 1
where id = 2
EF
var cars= new Cars();
cars.Id= 2;
db.Cars.Attach(cars);
var entry = db.Entry(cars);
entry.Property(e => e.counted).IsModified = true;
db.SaveChanges();
How to do that?