adjust DTOs

This commit is contained in:
Stanley Dimant
2022-07-24 14:31:22 +02:00
parent 91143894e5
commit f361992097
2 changed files with 54 additions and 4 deletions

View File

@@ -1,13 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace MareSynchronos.API
{
public record FileReplacementDto
public class FileReplacementDto
{
public string[] GamePaths { get; set; } = Array.Empty<string>();
public string Hash { get; set; }
public override bool Equals(object? otherObj)
{
if (otherObj == null || otherObj is not FileReplacementDto other) return false;
return Hash == other.Hash && Enumerable.SequenceEqual(GamePaths, other.GamePaths);
}
public override int GetHashCode()
{
return HashCode.Combine(GetOrderIndependentHashCode(GamePaths), Hash);
@@ -23,5 +30,10 @@ namespace MareSynchronos.API
}
return hash;
}
public override string ToString()
{
return Hash + ":" + string.Join(",", GamePaths);
}
}
}