private async Task Add() { if (PortToCreate != null && SmtpToCreate != null) { var newHost = new Host() { Server = SmtpToCreate, Port = int.Parse(PortToCreate) }; _hostService.Add(newHost); Hosts = new ObservableCollection <Host>(_hostService.GetAll()); Messenger.Default.Send(newHost); } }
public IActionResult GetAll() { Thread.Sleep(1000); var result = _hostService.GetAll(); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public ActionResult <IEnumerable <Host> > Get() { return(Ok(_hostServices.GetAll())); }
private void EditHostList(Host editedHost) { SmtpServers = new ObservableCollection <string>(_hostService.GetAll().Select(x => x.Server)); }