如何SQL时间戳在.NET比较?时间、SQL、NET

2023-09-02 01:58:44 作者:我的爱已过期

我已经映射实体框架的实体。在SQL Server 2008中的每个表包含了被映射为字节数组timestamp列。数组的长度始终是8。

I have mapped Entity framework entities. Each table in SQL Server 2008 contains Timestamp column which is mapped as byte array. The length of array is always 8.

现在我需要在.NET比较时间戳值。我来了两个解决方案,但我不知道哪一个更好?

Now I need to compare timestamp values in .NET. I come with two solutions but I don't know which one is better?

比较它的阵列。当第一个字节对是不同的返回假的。 在转换字节数组长,比较多头。

哪种解决方案更好?或者有没有其他的解决办法吗?

Which solution is better? Or is there any other solution?

推荐答案

我们通过比较它们的字节数组做到这一点。对我们工作的罚款。

We do it by comparing them as byte arrays. Works fine for us.

 
精彩推荐
图片推荐