Questions tagged as 'asp.net-mvc'

2
answers

Select separated by semicolons for xls

I have the following code: var cmd = @"SELECT mt.Id + ';' + mt.Nome + ';' + mt.Cidade AS Resultado FROM MinhaTable mt"; var objectContext = ((IObjectContextAdapter)db).ObjectContext; var resul...
asked by 08.09.2015 / 15:06
2
answers

Problems with routing using asp.net core

When trying to route a core 2.0 application, I can not reach the controller. public class GetClientController : Controller { LoadClient loadClient = new LoadClient(); [HttpGet] public IEnumerable<Cliente> Get...
asked by 18.06.2018 / 23:00
1
answer

How to pass an object or list of objects from Controller to View?

Controller: [HttpPost] public ActionResult Create(Pedido pedido) { List<Produto> lista = new List<Produto>(); if (ModelState.IsValid) { Cliente cliente = unitOf...
asked by 28.10.2015 / 18:04
2
answers

How to put a url in web.config

I have a service that calls this service: public async Task<List<Funcionario>> GetFuncionarios() { string url = $"http://localhost:56137/api/GetFuncionario"; var response = await client.GetStringAsyn...
asked by 14.08.2018 / 09:51
1
answer

How to use a padleft (11) in a get in the API

This is the method I have in my MVC public async Task<List<FuncionarioViewModel>> GetFuncionariosVM() { string url = $"http://localhost:56137/api/GetFuncionario"; var response = await client.GetStrin...
asked by 13.08.2018 / 15:04
1
answer

Solution for GetRange error accessing elements off the list

When calling the GetRange of a list, where it calls 10 in 10 list values at a time, however, it gives the following error:    Offset and length were out of bounds for the array or count greater   than the number of elements from index...
asked by 04.10.2016 / 13:38
1
answer

Catch the return of a WebAPI method? [closed]

I have the following code and I want to get a return on the result variable if it is true or false, how could I do this? //http://localhost:1608/api/ApiCidade/deletar/cliente/10 [HttpDelete] [Route("deletar/cliente/{id:int}")] public HttpRespo...
asked by 06.11.2015 / 02:50
1
answer

Problem with Asp.net MVC routes

I have an application that I put in as a new site and it worked perfectly, but by putting that application inside another, it gives an error in the route. I need to sign in when you sign in to " link " and it is pointing to " link ". Excerpt whe...
asked by 23.07.2015 / 17:01
1
answer

How is this class working? [closed]

DataSet OleDbConnection OleDbCommand OleDbDataAdapter OleDbDataReader I still can not understand this class in .NET. What is the purpose of these dataSets and etc? I'm using this: using System; using System.Collections.Generic; using System....
asked by 08.02.2016 / 14:29
1
answer

Put mask in @ Html.EditorFor [closed]

In the database, the CPF field is bigint and long in the model. I have two problems with this: 1) If the cpf starts with 0 or 00, it will not record this and then, to display on the screen, I will have to use algon as padleft (11) or similiar. 2...
asked by 10.08.2018 / 19:50