Infört Observable Property överallt, där tillämpligt
This commit is contained in:
@ -3,95 +3,40 @@ using SQLite;
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
[Table("GamePoint")]
|
||||
public class GamePoint : ObservableObject
|
||||
public partial class GamePoint : ObservableObject
|
||||
{
|
||||
public GamePoint()
|
||||
{
|
||||
_gamePointId = 0;
|
||||
_participantId = 0;
|
||||
_gameRoundId = 0;
|
||||
_gameDate = DateTime.Now;
|
||||
_gameRoundRegNr = 0;
|
||||
_gameRegPoints = 0;
|
||||
GamePointId = 0;
|
||||
ParticipantId = 0;
|
||||
GameRoundId = 0;
|
||||
GameDate = DateTime.Now;
|
||||
GameRoundRegNr = 0;
|
||||
GameRegPoints = 0;
|
||||
}
|
||||
|
||||
private int _gamePointId;
|
||||
private int _participantId;
|
||||
private int _gameRoundId;
|
||||
private DateTime _gameDate;
|
||||
private int _gameRoundRegNr;
|
||||
private int _gameRegPoints;
|
||||
[ObservableProperty]
|
||||
[property: PrimaryKey, AutoIncrement, Column("GamePointId")]
|
||||
private int gamePointId;
|
||||
|
||||
[PrimaryKey]
|
||||
[AutoIncrement]
|
||||
[Column("GamePointId")]
|
||||
public int GamePointId
|
||||
{
|
||||
get { return _gamePointId; }
|
||||
set
|
||||
{
|
||||
_gamePointId = value;
|
||||
OnPropertyChanged(nameof(GamePointId));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
[property: Column("ParticipantId")]
|
||||
private int participantId;
|
||||
|
||||
[Column("ParticipantId")]
|
||||
public int ParticipantId
|
||||
{
|
||||
get { return _participantId; }
|
||||
set
|
||||
{
|
||||
_participantId = value;
|
||||
OnPropertyChanged(nameof(ParticipantId));
|
||||
}
|
||||
}
|
||||
[Column("GameRoundId")]
|
||||
public int GameRoundId
|
||||
{
|
||||
get { return _gameRoundId; }
|
||||
set
|
||||
{
|
||||
_gameRoundId = value;
|
||||
OnPropertyChanged(nameof(GameRoundId));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
[property: Column("GameRoundId")]
|
||||
private int gameRoundId;
|
||||
|
||||
[Column("GameDate")]
|
||||
public DateTime GameDate
|
||||
{
|
||||
get { return _gameDate; }
|
||||
set
|
||||
{
|
||||
_gameDate = value;
|
||||
OnPropertyChanged(nameof(GameDate));
|
||||
}
|
||||
}
|
||||
|
||||
// GameRoundRegNr räknas upp när en spelare får en ny gamepoint inlagd
|
||||
// Alltså hans/hennes senaste i samma runda uppräknad med 1
|
||||
|
||||
[Column("GameRoundRegNr")]
|
||||
public int GameRoundRegNr
|
||||
{
|
||||
get { return _gameRoundRegNr; }
|
||||
set
|
||||
{
|
||||
_gameRoundRegNr = value;
|
||||
OnPropertyChanged(nameof(GameRoundRegNr));
|
||||
}
|
||||
}
|
||||
|
||||
[Column("GameRegPoints")]
|
||||
public int GameRegPoints
|
||||
{
|
||||
get { return _gameRegPoints; }
|
||||
set
|
||||
{
|
||||
_gameRegPoints = value;
|
||||
OnPropertyChanged(nameof(GameRegPoints));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
[property: Column("GameDate")]
|
||||
private DateTime gameDate;
|
||||
|
||||
[ObservableProperty]
|
||||
[property: Column("GameRoundRegNr")]
|
||||
private int gameRoundRegNr;
|
||||
|
||||
[ObservableProperty]
|
||||
[property: Column("GameRegPoints")]
|
||||
private int gameRegPoints;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user