Archetektur angefangen
This commit is contained in:
11
DataStoring.CSV/DataStoring.CSV.csproj
Normal file
11
DataStoring.CSV/DataStoring.CSV.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DataStoring.Contract\DataStoring.Contract.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
23
DataStoring.CSV/KundenRepository.cs
Normal file
23
DataStoring.CSV/KundenRepository.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using KanSan.CrossCutting.DataClasses;
|
||||
using KanSan.DataStoring.Contract;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace KanSan.DataStoring.CSV
|
||||
{
|
||||
public class KundenRepository : IKundenRepository
|
||||
{
|
||||
public List<Kunde> Query => File
|
||||
.ReadAllLines("kunden.csv")
|
||||
.Select(l => l.Split(','))
|
||||
.Select(p => new Kunde
|
||||
{
|
||||
ID = int.Parse(p[0]),
|
||||
Vorname = p[1],
|
||||
Nachname = p[2]
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user