public IActionResult Add([FromBody] EntryLogViewModel viewModel) { viewModel.UserId = this.UserId; if (!ModelState.IsValid) { return(BadRequest(ModelState)); } entryLogAppService.Create(viewModel); return(Ok()); }
public IActionResult Edit([FromBody] EntryLogViewModel viewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } viewModel.UserId = this.UserId; entryLogAppService.Update(viewModel); return(Ok()); }
public void Entry([FromBody] EntryLogViewModel entryLog) { LogEntry(entryLog); var storedPlate = storedPlateService.Get(s => s.Plate == entryLog.Plate).FirstOrDefault(); if (storedPlate != null && storedPlate.AutoOpen) { OpenGate(); } else { firebaseService.SendMessage(entryLog.Plate); } }
private void LogEntry(EntryLogViewModel entryLog) { entryLogService.Insert(entryLog); }
public void Update(EntryLogViewModel entryLogViewModel) { var addCommand = mapper.Map <UpdateEntryLogCommand>(entryLogViewModel); mediatorHandler.SendCommand(addCommand); }