public async Task <IActionResult> Create([Bind("ID,SensorType,SensorID,Value,TimeStamp")] SensorValue sensorValue) { if (ModelState.IsValid) { _context.Add(sensorValue); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(sensorValue)); }
public async Task <IActionResult> Create([Bind("ID,SensorID,ErrorType,Message,TimeStamp")] Error error) { if (ModelState.IsValid) { _context.Add(error); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(error)); }
public async Task <IActionResult> Create([Bind("ID,Name,ActionThreshold")] Sensor sensor) { if (ModelState.IsValid) { _context.Add(sensor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(sensor)); }
public async Task <IActionResult> Create([Bind("ID,SensorID,NotificationType,Message,TimeStamp")] NotificationEntry notificationEntry) { if (ModelState.IsValid) { _context.Add(notificationEntry); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(notificationEntry)); }