Initial commit
This commit is contained in:
29
CardMarketServer/UsedRepository.cs
Normal file
29
CardMarketServer/UsedRepository.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CardMarketServer
|
||||
{
|
||||
internal class UsedRepository : IUsedRepository
|
||||
{
|
||||
const string FILENAME = "usedList.csv";
|
||||
public List<string> Query => File
|
||||
.ReadLines(FILENAME)
|
||||
.Select(l => l.Split(','))
|
||||
.Select(p => new string(p[0]))
|
||||
.ToList();
|
||||
|
||||
void insert(string key)
|
||||
{
|
||||
key += Environment.NewLine;
|
||||
File.AppendAllText(FILENAME,key);
|
||||
}
|
||||
|
||||
public void Insert(string bestellungid)
|
||||
{
|
||||
insert(bestellungid);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user