diff --git a/.vs/AlfaPrentice/v16/.suo b/.vs/AlfaPrentice/v16/.suo index fff6a1d..f5d10ad 100644 Binary files a/.vs/AlfaPrentice/v16/.suo and b/.vs/AlfaPrentice/v16/.suo differ diff --git a/AlfaPrentice/Controllers/BedrijfController.cs b/AlfaPrentice/Controllers/BedrijfController.cs index f0d88a4..6d4a8c0 100644 --- a/AlfaPrentice/Controllers/BedrijfController.cs +++ b/AlfaPrentice/Controllers/BedrijfController.cs @@ -17,37 +17,55 @@ namespace AlfaPrentice.Controllers { //constructor public readonly AlfaPrenticeContext _context; + + + public BedrijfController(AlfaPrenticeContext context) { _context = context; } //getbedrijf - [HttpGet("{Bedrijf_ID}")] - public async Task> GetBedrijf(int Bedrijf_ID) + [HttpGet] + public async Task>> GetBedrijven() { - return await _context.Bedrijf.Where(B => B.Bedrijf_ID == Bedrijf_ID).ToListAsync(); - // return getBedrijf; + return await _context.Bedrijf + .Select(x => bedrijfData(x)) + .ToListAsync(); + } // GET: api/ - /* [HttpGet] - public IEnumerable Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api//5 - [HttpGet("{id}")] - public string Get(int id) - { - return "value"; - } + /* [HttpGet] + public IEnumerable Get() + { + return new string[] { "value1", "value2" }; + } - // POST api/ - [HttpPost] - public void Post([FromBody] string value) - { - }*/ + // GET api//5 + [HttpGet("{id}")] + public string Get(int id) + { + return "value"; + } + + // POST api/ + [HttpPost] + public void Post([FromBody] string value) + { + }*/ + + private static Bedrijf bedrijfData(Bedrijf bedrijf) => + new Bedrijf + { + Bedrijf_ID = bedrijf.Bedrijf_ID, + Adres_ID = bedrijf.Adres_ID, + Naam = bedrijf.Naam, + Logo = bedrijf.Logo, + Beschrijving = bedrijf.Beschrijving, + Email = bedrijf.Email, + Telefoon = bedrijf.Telefoon, + Status = bedrijf.Status + }; } } diff --git a/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.dll b/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.dll index f171b93..b238312 100644 Binary files a/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.dll and b/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.dll differ diff --git a/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.pdb b/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.pdb index 5a85be1..d307467 100644 Binary files a/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.pdb and b/AlfaPrentice/bin/Debug/net5.0/AlfaPrentice.pdb differ diff --git a/AlfaPrentice/bin/Debug/net5.0/ref/AlfaPrentice.dll b/AlfaPrentice/bin/Debug/net5.0/ref/AlfaPrentice.dll index 6aa9374..5325494 100644 Binary files a/AlfaPrentice/bin/Debug/net5.0/ref/AlfaPrentice.dll and b/AlfaPrentice/bin/Debug/net5.0/ref/AlfaPrentice.dll differ diff --git a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.csproj.FileListAbsolute.txt b/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.csproj.FileListAbsolute.txt index 5cba6c9..17895c1 100644 --- a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.csproj.FileListAbsolute.txt +++ b/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.csproj.FileListAbsolute.txt @@ -267,7 +267,6 @@ C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\obj\Deb C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\obj\Debug\net5.0\ref\AlfaPrentice.dll C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\obj\Debug\net5.0\AlfaPrentice.pdb C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\obj\Debug\net5.0\AlfaPrentice.genruntimeconfig.cache -C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\obj\Debug\net5.0\AlfaPrentice.csprojAssemblyReference.cache C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\bin\Debug\net5.0\BouncyCastle.Crypto.dll C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\bin\Debug\net5.0\Google.Protobuf.dll C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\bin\Debug\net5.0\K4os.Compression.LZ4.dll diff --git a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.csprojAssemblyReference.cache b/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.csprojAssemblyReference.cache deleted file mode 100644 index f797be1..0000000 Binary files a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.csprojAssemblyReference.cache and /dev/null differ diff --git a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.dll b/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.dll index f171b93..b238312 100644 Binary files a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.dll and b/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.dll differ diff --git a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.pdb b/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.pdb index 5a85be1..d307467 100644 Binary files a/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.pdb and b/AlfaPrentice/obj/Debug/net5.0/AlfaPrentice.pdb differ diff --git a/AlfaPrentice/obj/Debug/net5.0/ref/AlfaPrentice.dll b/AlfaPrentice/obj/Debug/net5.0/ref/AlfaPrentice.dll index 6aa9374..5325494 100644 Binary files a/AlfaPrentice/obj/Debug/net5.0/ref/AlfaPrentice.dll and b/AlfaPrentice/obj/Debug/net5.0/ref/AlfaPrentice.dll differ