Infört Observable Property överallt, där tillämpligt
This commit is contained in:
@ -6,72 +6,34 @@ namespace GreadyPoang.EntityLayer;
|
||||
|
||||
[Table("GameRound")]
|
||||
|
||||
public class GameRound : ObservableObject
|
||||
public partial class GameRound : ObservableObject
|
||||
{
|
||||
public GameRound()
|
||||
{
|
||||
_gameRoundId = 0;
|
||||
_gameRoundStartDate = DateTime.Now;
|
||||
_gameStatus = GamePointStatus.New;
|
||||
_gameRoundFinished = null;
|
||||
GameRoundId = 0;
|
||||
GameRoundStartDate = DateTime.Now;
|
||||
GameStatus = GamePointStatus.New;
|
||||
GameRoundFinished = null;
|
||||
}
|
||||
|
||||
private int _gameRoundId;
|
||||
private DateTime _gameRoundStartDate;
|
||||
private GamePointStatus _gameStatus;
|
||||
private DateTime? _gameRoundFinished;
|
||||
[ObservableProperty]
|
||||
[property: PrimaryKey, AutoIncrement, Column("GameRoundId")]
|
||||
private int gameRoundId;
|
||||
|
||||
[Column("GameRoundFinished")]
|
||||
public DateTime? GameRoundFinished
|
||||
{
|
||||
get { return _gameRoundFinished; }
|
||||
set
|
||||
{
|
||||
_gameRoundFinished = value;
|
||||
OnPropertyChanged(nameof(GameRoundFinished));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
[property: Column("GameRoundStartDate")]
|
||||
private DateTime gameRoundStartDate;
|
||||
|
||||
[Column("GameRoundStartDate")]
|
||||
public DateTime GameRoundStartDate
|
||||
{
|
||||
get { return _gameRoundStartDate; }
|
||||
set
|
||||
{
|
||||
_gameRoundStartDate = value;
|
||||
OnPropertyChanged(nameof(GameRoundStartDate));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
[property: Column("GameStatus")]
|
||||
private GamePointStatus gameStatus;
|
||||
|
||||
[Column("GameStatus")]
|
||||
public GamePointStatus GameStatus
|
||||
{
|
||||
get { return _gameStatus; }
|
||||
set
|
||||
{
|
||||
_gameStatus = value;
|
||||
OnPropertyChanged(nameof(GameStatus));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[PrimaryKey]
|
||||
[AutoIncrement]
|
||||
[Column("GameRoundId")]
|
||||
public int GameRoundId
|
||||
{
|
||||
get { return _gameRoundId; }
|
||||
set
|
||||
{
|
||||
_gameRoundId = value;
|
||||
OnPropertyChanged(nameof(GameRoundId));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
[property: Column("GameRoundFinished")]
|
||||
private DateTime? gameRoundFinished;
|
||||
|
||||
public string GameRoundStartDateString
|
||||
{
|
||||
get { return _gameRoundStartDate.ToString("yyyy-MM-dd"); }
|
||||
get { return GameRoundStartDate.ToString("yyyy-MM-dd"); }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user