getbedrijven function toegevoegd
This commit is contained in:
parent
5da9e78e3f
commit
ba004152d6
Binary file not shown.
@ -17,37 +17,55 @@ namespace AlfaPrentice.Controllers
|
|||||||
{
|
{
|
||||||
//constructor
|
//constructor
|
||||||
public readonly AlfaPrenticeContext _context;
|
public readonly AlfaPrenticeContext _context;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BedrijfController(AlfaPrenticeContext context)
|
public BedrijfController(AlfaPrenticeContext context)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
//getbedrijf
|
//getbedrijf
|
||||||
[HttpGet("{Bedrijf_ID}")]
|
[HttpGet]
|
||||||
public async Task<IEnumerable<Bedrijf>> GetBedrijf(int Bedrijf_ID)
|
public async Task<ActionResult<IEnumerable<Bedrijf>>> GetBedrijven()
|
||||||
{
|
{
|
||||||
return await _context.Bedrijf.Where(B => B.Bedrijf_ID == Bedrijf_ID).ToListAsync();
|
return await _context.Bedrijf
|
||||||
// return getBedrijf;
|
.Select(x => bedrijfData(x))
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: api/<BedrijfController>
|
// GET: api/<BedrijfController>
|
||||||
/* [HttpGet]
|
/* [HttpGet]
|
||||||
public IEnumerable<string> Get()
|
public IEnumerable<string> Get()
|
||||||
{
|
{
|
||||||
return new string[] { "value1", "value2" };
|
return new string[] { "value1", "value2" };
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<BedrijfController>/5
|
|
||||||
[HttpGet("{id}")]
|
|
||||||
public string Get(int id)
|
|
||||||
{
|
|
||||||
return "value";
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST api/<BedrijfController>
|
// GET api/<BedrijfController>/5
|
||||||
[HttpPost]
|
[HttpGet("{id}")]
|
||||||
public void Post([FromBody] string value)
|
public string Get(int id)
|
||||||
{
|
{
|
||||||
}*/
|
return "value";
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST api/<BedrijfController>
|
||||||
|
[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
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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\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.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.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\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\Google.Protobuf.dll
|
||||||
C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\bin\Debug\net5.0\K4os.Compression.LZ4.dll
|
C:\Users\Xandra Mentink\Documents\AlfaPrentice\AlfaPrentice\AlfaPrentice\bin\Debug\net5.0\K4os.Compression.LZ4.dll
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user