dev_0.2 #4
@ -29,6 +29,9 @@ public class LocalStore<T> : IStore<T>
|
|||||||
using (FileStream fs = new FileStream(this.filePath, FileMode.OpenOrCreate))
|
using (FileStream fs = new FileStream(this.filePath, FileMode.OpenOrCreate))
|
||||||
using (StreamWriter writer = new StreamWriter(fs, DefaultEncoding))
|
using (StreamWriter writer = new StreamWriter(fs, DefaultEncoding))
|
||||||
{
|
{
|
||||||
|
fs.Seek(0, SeekOrigin.Begin);
|
||||||
|
fs.SetLength(0);
|
||||||
|
|
||||||
foreach (T item in this.items)
|
foreach (T item in this.items)
|
||||||
{
|
{
|
||||||
string json = JsonSerializer.Serialize<T>(item);
|
string json = JsonSerializer.Serialize<T>(item);
|
||||||
|
Loading…
Reference in New Issue
Block a user