|
|
@ -83,7 +83,16 @@ namespace Model.Dice
|
|
|
|
/// <exception cref="ArgumentNullException"></exception>
|
|
|
|
/// <exception cref="ArgumentNullException"></exception>
|
|
|
|
public Task<DiceGroup> Update(DiceGroup before, DiceGroup after)
|
|
|
|
public Task<DiceGroup> Update(DiceGroup before, DiceGroup after)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// pas autorisé de changer les dés, juste le nom
|
|
|
|
|
|
|
|
|
|
|
|
var results= after.Dice.Where(dice => before.Dice.Contains(after.Dice[0]));
|
|
|
|
|
|
|
|
/* foreach(Die die in before.Dice)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (after.Dice.Contains((die)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ArgumentException("the group of dice cannot be updated, only the name", nameof(before));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
// pas autorisé de changer les dés, juste le nom
|
|
|
|
if (!before.Dice.SequenceEqual(after.Dice))
|
|
|
|
if (!before.Dice.SequenceEqual(after.Dice))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new ArgumentException("the group of dice cannot be updated, only the name", nameof(before));
|
|
|
|
throw new ArgumentException("the group of dice cannot be updated, only the name", nameof(before));
|
|
|
|