Entity Framework formats DateTime SQL parameter without milliseconds for optimistic concurrency
I'm trying to use a DateTime LastModifiedDate column with optimistic concurrency in Entity Framework (will likely upgrade it to DateTime2.) I've set the Concurrency Mode to Fixed. But when I retrieve an entity, change a column and try to save, get a concurrency exception. The stored LastModifiedDate is 2017-01-04 21:16:55.283 but look at the SQL Entity Framework is generating for the update: UPDATE [dbo].[Facilities] SET [Password] = @0 WHERE (([pk_FacilityID] = @1) AND ([LastModifiedDate] = @2)) -- @0: 'bz0dkK+smlat9psrIrbyXkxjpcXcDK1DeUiha7jCRkU=' (Type = String, Size = 255) -- @1: '6801bdcf