private async Task <List <VisaTypeListViewModel> > GetItemsAsync() { List <VisaTypeListViewModel> list = _repository.GetVisaTypes() .Select(p => ModelFactory.Create(p)) .ToList(); return(list); }
public async Task <IActionResult> RemoveVisaType(int Id) { if (Id > 0) { var Visatypes = _repository.GetVisaTypes(); var toDelete = Visatypes.Find(p => p.VisaTypeId == Id); _repository.Remove(toDelete); if (await _repository.Save()) { return(Json(true)); } else { return(Json(false)); } } return(Json(false)); }