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.GetStringAsync(url);
var _funcionario = JsonConvert.DeserializeObject<List<FuncionarioViewModel>>(response);
return _funcionario;
}
I need to give m padleft (11) in the CPF field and I do not know how to do it. Below the get method in the API
public class GetFuncionario
{
BancoContext banco = new BancoContext();
//Método que retorna uma lista de funcionarios
public List<Funcionario> GetFuncionarios()
{
return banco.Database.SqlQuery<Funcionario>("sp_cons_funcionarios").ToList();
}
}
Because it is a numeric field, I need a padleft (11) for cpf that starts with 0 and cuts the 0 to the left. How do I do this?