Skip to content

Commit

Permalink
Update MsDataScanModelsController.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
elaboy committed Jan 4, 2024
1 parent c33b378 commit 473a3a1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions MetaPAL/Controllers/MsDataScanModelsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ public MsDataScanModelsController(ApplicationDbContext context)
// GET: MsDataScanModels
public async Task<IActionResult> Index()
{
return _context.MsDataScan != null ?
View(await _context.MsDataScan.ToListAsync()) :
return _context.MsDataScans != null ?
View(await _context.MsDataScans.ToListAsync()) :
Problem("Entity set 'ApplicationDbContext.MsDataScan' is null.");
}

// GET: MsDataScanModels/Details/5
public async Task<IActionResult> Details(int? id)
{
if (id == null || _context.MsDataScan == null)
if (id == null || _context.MsDataScans == null)
{
return NotFound();
}

var msDataScanModel = await _context.MsDataScan
var msDataScanModel = await _context.MsDataScans
.FirstOrDefaultAsync(m => m.Id == id);
if (msDataScanModel == null)
{
Expand Down Expand Up @@ -67,12 +67,12 @@ public async Task<IActionResult> Create([Bind("Id,ScanNumber,SpectrumRepresentat
// GET: MsDataScanModels/Edit/5
public async Task<IActionResult> Edit(int? id)
{
if (id == null || _context.MsDataScan == null)
if (id == null || _context.MsDataScans == null)
{
return NotFound();
}

var msDataScanModel = await _context.MsDataScan.FindAsync(id);
var msDataScanModel = await _context.MsDataScans.FindAsync(id);
if (msDataScanModel == null)
{
return NotFound();
Expand Down Expand Up @@ -118,12 +118,12 @@ public async Task<IActionResult> Edit(int id, [Bind("Id,ScanNumber,SpectrumRepre
// GET: MsDataScanModels/Delete/5
public async Task<IActionResult> Delete(int? id)
{
if (id == null || _context.MsDataScan == null)
if (id == null || _context.MsDataScans == null)
{
return NotFound();
}

var msDataScanModel = await _context.MsDataScan
var msDataScanModel = await _context.MsDataScans
.FirstOrDefaultAsync(m => m.Id == id);
if (msDataScanModel == null)
{
Expand All @@ -138,14 +138,14 @@ public async Task<IActionResult> Delete(int? id)
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)
{
if (_context.MsDataScan == null)
if (_context.MsDataScans == null)
{
return Problem("Entity set 'ApplicationDbContext.MsDataScan' is null.");
}
var msDataScanModel = await _context.MsDataScan.FindAsync(id);
var msDataScanModel = await _context.MsDataScans.FindAsync(id);
if (msDataScanModel != null)
{
_context.MsDataScan.Remove(msDataScanModel);
_context.MsDataScans.Remove(msDataScanModel);
}

await _context.SaveChangesAsync();
Expand All @@ -154,7 +154,7 @@ public async Task<IActionResult> DeleteConfirmed(int id)

private bool MsDataScanModelExists(int id)
{
return (_context.MsDataScan?.Any(e =>
return (_context.MsDataScans?.Any(e =>
e.Id == id)).GetValueOrDefault();
}

Expand All @@ -170,7 +170,7 @@ public IActionResult ReadMsDataFile(string path)

if (ModelState.IsValid)
{
_context.MsDataScan.AddRange(msDataFile);
_context.MsDataScans.AddRange(msDataFile);
_context.SaveChanges();
return RedirectToAction(nameof(Index));
}
Expand Down

0 comments on commit 473a3a1

Please sign in to comment.