// GET api/values public List <ClientViewModel> GetUsers() { IEnumerable <Client> clients = _clientApp.GetAll(); List <ClientViewModel> list = Mapper.Map <List <ClientViewModel> >(clients); return(list); }
public ActionResult Index() { Client client1 = _clientApp.GetAll().FirstOrDefault(); ClientViewModel list2 = Mapper.Map <ClientViewModel>(client1); IEnumerable <Client> clients = _clientApp.GetAll(); List <ClientViewModel> list = Mapper.Map <List <ClientViewModel> >(clients); //var clientViewModel = _clientApp.GetAll(); return(View()); }
// GET: Client public ActionResult Index() { var clients = _serviceApp.GetAll(); var clientsViewModel = _mapper.Map <IEnumerable <ClientViewModel> >(clients); return(View(clientsViewModel)); }
public IActionResult GetAll() { var clients = clientService.GetAll(); var clientsModel = mapper.Map <ICollection <ClientModel> >(clients); return(Ok(clientsModel)); }
// GET: Clients public ActionResult Index() { var clientViewModel = Mapper.Map <IEnumerable <Client>, IEnumerable <ClientViewModel> >(_clientAppService.GetAll()); return(View(clientViewModel)); }
public async Task <ActionResult> Index() { var output = await _ClientAppService.GetAll(); var model = new IndexViewModel(output.Items); return(View(model)); }
public HttpResponseMessage Get() { try { var clients = _clientAppService.GetAll(); return(Request.CreateResponse(HttpStatusCode.OK, clients)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message)); } }
public async Task <IEnumerable <ClientViewModel> > GetClients() { var clients = await clientAppService.GetAll(); return(clients); }
// GET: Product/Create public ActionResult Create() { ViewBag.ClientId = new SelectList(_clientApp.GetAll(), "Id", "FirstName"); return(View()); }
public Task <HttpResponseMessage> GetClients() { HttpResponseMessage response = new HttpResponseMessage(); try { var clients = Mapper.Map <IEnumerable <Client>, IEnumerable <ClientViewModel> >(_service.GetAll()); response = Request.CreateResponse(HttpStatusCode.OK, clients); } catch (Exception ex) { response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message); } var tsc = new TaskCompletionSource <HttpResponseMessage>(); tsc.SetResult(response); return(tsc.Task); }
public ActionResult Index() { return(View(_clientAppService.GetAll())); }
// GET: Sp/Clients public ActionResult Index(DateTime?birthDay, string cpf = "") { var clients = Mapper.Map <IEnumerable <Client>, IEnumerable <ClientViewModel> >(_clientAppService.GetAll()); clients = clients .Where(c => (birthDay != null ? c.BirthDay == birthDay : true) && (!string.IsNullOrEmpty(cpf) ? c.Cpf.Contains(cpf) : true) ); ObjIndex obj = new ObjIndex(); obj.Cpf = cpf; obj.BirthDay = birthDay; obj.Clients = clients; return(View(obj)); }
// GET: api/Clients public IEnumerable <ClientViewModel> Get() { return(_clientAppService.GetAll()); }
public async Task <IActionResult> GetAll() { try { return(Ok(ResponceViewModel <IEnumerable <ClientViewModel> > .GenerateRepsonce(await appService.GetAll()))); } catch (Exception ex) { logger.LogError($"Exception thrown in get all clients: {ex}"); return(BadRequest(ResponceViewModel <string> .GenerateError($"Get all clients failed. {ex.Message}"))); } }
// GET: Product/Create public ActionResult Create() { ViewBag.ClientID = new SelectList(_clientApp.GetAll(), nameof(Client.ClientID), nameof(Client.Name)); return(View()); }
public async Task <IActionResult> Index() { var clients = await clientAppService.GetAll(); return(View(clients)); }