commiting some changes
This commit is contained in:
@@ -54,11 +54,11 @@ namespace WebApp.Controllers
|
||||
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create([Bind("Id,StartDate,EndDate")] Rents rents)
|
||||
public async Task<IActionResult> Create([Bind("Id,CarId,StartDate,EndDate,UserId")] Rents rents)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var car = _context.Cars.FirstOrDefault(car => car.Id == 1);
|
||||
var car = _context.Cars.FirstOrDefault(car => car.Id == rents.CarId);
|
||||
rents.Car = car;
|
||||
_context.Add(rents);
|
||||
await _context.SaveChangesAsync();
|
||||
@@ -88,7 +88,7 @@ namespace WebApp.Controllers
|
||||
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(int id, [Bind("Id,StartDate,EndDate")] Rents rents)
|
||||
public async Task<IActionResult> Edit(int id, [Bind("Id,CarId,StartDate,EndDate,UserId")] Rents rents)
|
||||
{
|
||||
if (id != rents.Id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user