public ActionResult Cars_Destroy([DataSourceRequest]DataSourceRequest request, CarAdminViewModel car) { if (this.ModelState.IsValid) { this.carServices.Delete(car.Id); } return this.Json(new[] { car }.ToDataSourceResult(request, this.ModelState)); }
public ActionResult Cars_Update([DataSourceRequest]DataSourceRequest request, CarAdminViewModel car) { if (this.ModelState.IsValid) { this.carServices.Update( car.Id, car.Brand, car.CarModel, car.Color, car.Year, car.TotalSeats, car.SpaceForLugage, car.Description); } return this.Json(new[] { car }.ToDataSourceResult(request, this.ModelState)); }