-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repro for a bug with null assignment
- Loading branch information
1 parent
b3dcbc7
commit e5a5d1a
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...mon/ViewModels/FeatureSamples/ViewModelDeserialization/PropertyNullAssignmentViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DotVVM.Framework.ViewModel; | ||
using DotVVM.Framework.Hosting; | ||
|
||
namespace DotVVM.Samples.Common.ViewModels.FeatureSamples.ViewModelDeserialization | ||
{ | ||
public class PropertyNullAssignmentViewModel : DotvvmViewModelBase | ||
{ | ||
|
||
public DateTime? NullableDateTime { get; set; } | ||
|
||
public DateTime Value { get; set; } = new DateTime(2023, 1, 2, 3, 4, 5, 678); | ||
|
||
public void SetNullableDateTimeToNull() | ||
{ | ||
NullableDateTime = null; | ||
} | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
...mples/Common/Views/FeatureSamples/ViewModelDeserialization/PropertyNullAssignment.dothtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@viewModel DotVVM.Samples.Common.ViewModels.FeatureSamples.ViewModelDeserialization.PropertyNullAssignmentViewModel, DotVVM.Samples.Common | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title></title> | ||
</head> | ||
<body> | ||
|
||
<p class="result">{{value: NullableDateTime}}</p> | ||
|
||
<dot:Button Text="Set value" Click="{command: NullableDateTime = Value}" /> | ||
<dot:Button Text="Set null" Click="{command: NullableDateTime = null}" /> | ||
<dot:Button Text="Set null with command" Click="{command: SetNullableDateTimeToNull()}" /> | ||
|
||
</body> | ||
</html> | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters