VB.NET EF6/MVC5.
: getdate(), getdate() . , . , getdate() , .
: getdate() getdate() ( , OUTPUT INSERTED.theTime). SQL-.
Dim theTime As DateTime? = db.Database.SqlQuery(Of DateTime?) _
("UPDATE myTable SET theTime = getdate() OUTPUT INSERTED.theTime WHERE someRecordID = @someRecordID", New SqlParameter("@someRecordID", someRecordID)).First()
, - ( MS, getdate() ?). , - .
, :
Dim craftBeer = context.CraftBeers.Find(id)
... (update other craftBeer properties) ...
craftBeer.date_emptied = SqlServer.SqlFunction.GetDate
context.Entry(craftBeer).State = EntityState.Modfied
context.SaveChanges()
... , , SqlServer.SqlFunctions.GetDate, , EF, .