This commit is contained in:
Sakurai Ryota 2024-08-12 12:46:55 +09:00
parent c8c152ae68
commit d9e3e7bf3b

View File

@ -29,6 +29,9 @@ public class LocalStore<T> : IStore<T>
using (FileStream fs = new FileStream(this.filePath, FileMode.OpenOrCreate))
using (StreamWriter writer = new StreamWriter(fs, DefaultEncoding))
{
fs.Seek(0, SeekOrigin.Begin);
fs.SetLength(0);
foreach (T item in this.items)
{
string json = JsonSerializer.Serialize<T>(item);