getbedrijven function toegevoegd
This commit is contained in:
parent
5da9e78e3f
commit
ba004152d6
Binary file not shown.
@ -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<IEnumerable<Bedrijf>> GetBedrijf(int Bedrijf_ID)
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Bedrijf>>> 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/<BedrijfController>
|
||||
/* [HttpGet]
|
||||
public IEnumerable<string> Get()
|
||||
{
|
||||
return new string[] { "value1", "value2" };
|
||||
}
|
||||
/* [HttpGet]
|
||||
public IEnumerable<string> Get()
|
||||
{
|
||||
return new string[] { "value1", "value2" };
|
||||
}
|
||||
|
||||
// GET api/<BedrijfController>/5
|
||||
[HttpGet("{id}")]
|
||||
public string Get(int id)
|
||||
{
|
||||
return "value";
|
||||
}
|
||||
// GET api/<BedrijfController>/5
|
||||
[HttpGet("{id}")]
|
||||
public string Get(int id)
|
||||
{
|
||||
return "value";
|
||||
}
|
||||
|
||||
// POST api/<BedrijfController>
|
||||
[HttpPost]
|
||||
public void Post([FromBody] string 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\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
|
||||
|
||||
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