File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
- using NHibernate . Engine ;
3
2
4
3
namespace NHibernate . Type
5
4
{
6
5
/// <summary>
7
- /// This is almost the exact same type as the <see cref="DateTimeType" /> excepted it can be used
8
- /// in the version column, stores it to the accuracy the database supports
9
- /// and will default to the value of <see cref="AbstractDateTimeType.Now" /> if the value is not valid.
6
+ /// This is almost the exact same type as the <see cref="DateTimeType" />.retrieved
10
7
/// </summary>
11
8
/// <remarks>
12
9
/// <para>
@@ -34,10 +31,6 @@ public class TimestampType : AbstractDateTimeType
34
31
/// <inheritdoc />
35
32
public override string Name => "Timestamp" ;
36
33
37
- /// <inheritdoc />
38
- protected override DateTime GetDateTimeToSet ( object value , ISessionImplementor session ) =>
39
- ( value as DateTime ? ) ?? Now ;
40
-
41
34
/// <summary>
42
35
/// Retrieve the string representation of the timestamp object. This is in the following format:
43
36
/// <code>
Original file line number Diff line number Diff line change 4
4
namespace NHibernate . Type
5
5
{
6
6
/// <summary>
7
- /// This is almost the exact same type as the <see cref="UtcDateTimeType" /> excepted it can be used
8
- /// in the version column, stores it to the accuracy the database supports
9
- /// and will default to the value of <see cref="AbstractDateTimeType.Now" /> if the value is not a datetime.
7
+ /// This is almost the exact same type as the <see cref="UtcDateTimeType" /> It is intended
8
+ /// for use as the version column.
10
9
/// Moreover, if the value is not an UTC value, it will throw.
11
10
/// </summary>
12
11
/// <remarks>
@@ -44,7 +43,7 @@ public class TimestampUtcType : TimestampType
44
43
/// <inheritdoc />
45
44
protected override DateTime GetDateTimeToSet ( object value , ISessionImplementor session )
46
45
{
47
- var dbValue = base . GetDateTimeToSet ( value , session ) ;
46
+ var dbValue = ( DateTime ) value ;
48
47
if ( dbValue . Kind != DateTimeKind . Utc )
49
48
throw new ArgumentException ( "Kind is NOT Utc" , nameof ( value ) ) ;
50
49
return dbValue ;
You can’t perform that action at this time.
0 commit comments