Questions tagged as 'asp.net-core'

1
answer

Pass two parameters - ASP.NET CORE

I need to pass two parameters to a page, when I'm trying to pass one, I do it this way: <a asp-page="/ContaReceber/Edit" asp-route-id="@item.Id;" class="btn btn-sm btn-success">Editar</a> I tried to pass something like: <a...
asked by 05.07.2018 / 16:30
3
answers

MVC: parameter in URL is not being passed to controller

I'm running the Action below, but the "CategoryObject" parameter is not being passed to the Controller. I'm working with asp.net core 2.0. public async Task<IActionResult> Buscar(string ArtigoOuCategoria) { ... } The Action call i...
asked by 08.07.2018 / 19:16
2
answers

Variable remains zero in a mathematical expression

My program looks like this: public void CalculaProporção() { decimal contagemSubida = 0 , contagemDescida = 0; int cSubida = 6, cDescida = 4, range = 10; contagemSubida += Convert.ToDecimal(cSubida*range/100...
asked by 01.11.2018 / 15:54
1
answer

aspnetmvc6 I can not update

To test the visual studo 2015 I created an asp.net mvc project and so wanting upgrades it to use the new version 6 beta. but with an error here How do I resolve this? I had to update the entity framework gave it Installing 'EntityFra...
asked by 27.12.2014 / 16:57
2
answers

Add subitems between groups with linq

How can I perform calculations between subitems of a group by query in linq? Here's an example: Linq Query var listPlanoDeContas = (from t in _planoDeContasRepository.GetAll() orderby t.Month ascending...
asked by 23.10.2018 / 18:56
1
answer

Dependency Injection - Error: InvalidOperationException: Unable to resolve service for type

Friends, once more I come to you for help. When trying to call an Action from my Controller I'm getting the problem described below:    An unhandled exception occurred while processing the request.   InvalidOperationException: Unable to re...
asked by 07.10.2018 / 17:00
1
answer

Save XML without formatting

I need to generate xml , however without jumping line, the way I generate it is all indented, how do I save without skipping line? document.LoadXml(soapEnvelope); document.Save(@"E:\nota.xml"); I tried this code below: XDocument doc...
asked by 27.11.2018 / 14:43
1
answer

How to show queries generated by EF core

A while ago, with a simple code within my context, it would display the queries generated by EF6 in the console or even write to a txt file ... However, today I use the Entity Framework Core in an asp.net core (MVC) application and wanted to...
asked by 03.10.2018 / 14:39
1
answer

Change URL of / controller? id = 1 to / controller / 1

In my view I have two buttons that pass parameters via GET to the index of my controller, the problem is that the URL does not stay with the traditional? id = 1 and I wanted to make it look like this: / controller / 1 View: @using (Html.B...
asked by 27.09.2018 / 19:59
1
answer

Consume via JQuery-Ajax, an API at localhost: 28033, from a page at localhost: 7545

I'm trying to do something, but it's not working. I have two .Net Core 2.0 projects, an API, and an MVC. I want to run ajax calls from the MVC project, to the Project Controllers API. I open two visual studios, and I run two projects: R...
asked by 07.07.2018 / 03:46