Most voted "asp.net-core" questions
ASP.NET Core is a Microsoft framework as a redesign of ASP.NET.
Learn more…663 questions
Sort by count of
-
0
votes1
answer480
viewsAsp.Net Core Webapi Returning Object List
I am trying to return a list of a "Plan" Template that has a list of "Expenses", returning only the plan list works, but when added to return the spending list of a javascript error. "Failed to load…
-
0
votes0
answers105
viewsField ? null is not sending if empty
I have this field: <label asp-for="TransportadorID" class="col-md-3 control-label" style="text-align:left;"></label> <div class="col-md-2"> <input type="text"…
-
0
votes1
answer272
viewsReturn list to ajax
I have this function to load some data, but the need to load a list and include in a table the function was thus: [HttpPost] public ActionResult CarregaProduto(string id) { try { var item =…
-
0
votes1
answer389
viewsWrite a Json string to the database c#
I am able to receive the data correctly, and being able to separate them correctly too, only problem is that I do not know how to use the values and be able to write in the database, could help me ?…
-
0
votes1
answer362
viewsHow to customize Asp.Net Core 2.1 login screen
With the following service settings below I can login to Twitter, Hotmail, Facebook. Noting that my project at the time of creation enabled the individual login option services.AddAuthentication()…
-
0
votes1
answer77
viewsreturning blank autocomplete
I do a search in my database to find the name of the products without exceptions (I don’t know if it’s relevant, but this return is a string list) var listaDosProdutos =…
-
0
votes1
answer275
viewsDropdownlist with Selectlist Item
I am trying to create a Select List, but in case it is returning it to my view: Microsoft.AspNetCore.Mvc.Rendering.Selectlistitem so is not returning the Cargos that are in my database and here are…
c# asp.net asp.net-mvc-5 asp.net-core entity-framework-coreasked 5 years, 11 months ago Matheus 616 -
0
votes1
answer105
viewsUpdate Role of the ASP.NET Identity user
hello guys I am finding it difficult to update the user role when updating my data, my roles are being filled by a Viewbag in my get from my controller and I am retrieving the new ID from my…
c# asp.net-mvc asp.net-mvc-5 asp.net-web-api asp.net-coreasked 5 years, 11 months ago Thiago Ubiratan 353 -
0
votes2
answers224
viewsException treatment not working
Hello, I am studying C# and I was trying to do exception treatment using middleware, to send the message and the exception code to the client, but it is not working very well. Debugging, breakpoint…
-
0
votes0
answers304
viewsMysqlexception . NET Core 2.1: Unknown column 'xxxx' in 'field list'
I have a bizarre mistake I’d like to share with you. I’m using Visual Studio 2017 and creating an MVC application with NET Core 2.1, based on a Mysql database and tables that already existed before.…
-
0
votes1
answer36
viewsCustomizing External Identity login on custom buttons
I’m trying to implement Externallogin in a web application with Facebook and Google, and the login screen is customized. As I am using DDD and CQRS, I have Identity uncoupled from the Asp.net core…
asp.net-coreasked 5 years, 10 months ago Uitan Maciel 193 -
0
votes1
answer33
viewsCreating/changing entities in batch
I’m reading a book from Angular 5 + Asp.NET Core 2.0 (although I’m using Angular 7 and Asp.NET Core 2.1), and I’m trying to do the system that this book teaches me to do. It is a quiz system, where…
-
0
votes0
answers14
viewsInvalidoperationexception: Unable to resolve service for type while attempting to Activate
This is probably a duplicate question, but all the questions I saw didn’t solve the problem. The mistake happening is: The flow is as follows: View -> Controller -> Service -> Repository…
c# entity-framework asp.net-core entity-framework-coreasked 5 years, 10 months ago Thiago Cunha 1,356 -
0
votes1
answer166
viewsUpdating only uploaded properties - Entity Framework
I am trying to abstract the methods to save/update the data of my models. I did a generic routine to abstract this operation but I have a little problem. In the scenario below I have the model…
-
0
votes1
answer98
viewsProblem with accentuated character in the return of the query
I have a Mysql database with encoding defined as latin1_swedish_ci. I’m using Dapper to connect the database. When I make a query to certain tables, the characters that are accented comes as follows…
-
0
votes1
answer34
viewsList of JS objects in the C# MVC Controller does not appear in the Request.Cookies
I’m putting the following Cookie: document.cookie = "Teste=" + '[{"Id":20,"Nome":"Prato Feito","Valor":12.5,"Quantidade":1,"Imagem":"/images/ImgEmpty/noImg.jpg","Descricao":"Batata Palha, Cebola,…
-
0
votes1
answer191
viewsHow to make the Login page become a standard route for an Asp.Net Core 2.2 application
The Login page is within the following folders Area - Identity - Pages - Account. How to make the Login Page become a standard route, this is when the user accesses the Asp.Net Core 2.2 application…
-
0
votes1
answer48
viewsProblem when trying to save data to the observation field
I have a problem when I will enter record in the Notes field. When the user writes a note and then right after click save the same is not registered. Customer Class: --> The Method I am using to…
-
0
votes1
answer235
viewsWeb Api does not return related data
I’m doing some tests with Web Api (Asp.net core). And with Eager Loading I’m trying to upload a related list, but what I get from Postman is this:…
c# asp.net web-service asp.net-web-api asp.net-coreasked 5 years, 9 months ago Márcio Sebastião 769 -
0
votes0
answers46
viewsWeb Api - Is it wrong to get a related object like this?
I started developing with Web Api (Asp.net Core) and I have a doubt about this right or wrong what I am doing... I have two classes in 1 to N: The Department class: public class Department { public…
c# web-service asp.net-web-api asp.net-core asp.net-core-web-apiasked 5 years, 8 months ago Márcio Sebastião 769 -
0
votes1
answer26
viewsYou are not accepting special characters via javascript
I created a file _Scriptspartial and inside that file is javascript code. Follows file _Layout: <!DOCTYPE html> <html> <head> <partial name="_Favicons" /> <meta…
-
0
votes0
answers31
viewsHow to perform 2 different submits in the same action?
I have a view with 2 different forms, when performing the first Submit I receive the data in the controller normally, when performing the second Submit the data comes all as nulls. How can I fix…
-
0
votes1
answer35
viewsBootstrap application in ASP.NET Core 2
Good morning, I have an application in ASP.NET Core 2 where I use the latest version of Bootstrap(4.3.1), I took some codes in the documentation but when I put them in my HTML they always appear…
-
0
votes1
answer71
viewsInject multiple Idbconnection into Asp.Net core
Good morning, you guys, all right? I need to inject 2 Dbcontext into Asp.net core and I’m having problems with it. Follow the code example. string defaultConnectionA =…
-
0
votes1
answer42
viewsError trying to install Ntoastnotify package by Nuget
I’m trying to install the package: Ntoastnotify version 5.0.10 in my system: Asp.Net Core 2.1 But I’m getting the following messages: Severity Code Description Project File Line Suppression State…
-
0
votes1
answer158
viewsHelp with COUNT mysql and Asp Net Core
In my system I have a form for opening calls, in which each call has the following status: Aberto, Agendado, Em Atendimento and Finalizado. I would like to exhibit in home the amount of each one…
-
0
votes0
answers370
viewsConfigure Startup.Cs in Asp.Net Core
Hello, I am unable to configure my Startup.Cs to run my application in . Net Core. The following error is being executed: An error occurred while Starting the application. Invalidoperationexception:…
-
0
votes0
answers76
viewsCheckbox does not send "False" value when performed Submit - Asp.net MVC
I have a mvc project in Asp.net core and I’m having problems performing a Submit. Well I "Seto" the properties of my Personal Model. return new PessoaContatoCorreioEletronicoViewModel {…
-
0
votes0
answers69
viewsAsp.Net Core making unexpected logout
I’m learning to work with Asp.Net Core, using version 2.1. After logging in, the system unexpectedly logs out, I could not find the reason, if it was error, wrong configuration... I’ve looked in…
-
0
votes1
answer327
viewsHow to create a list of Roles in Claim using ASP.NET Core
I made an authentication using Claims with cookies in the ASP.NET Core. In the Method below, the object by parameter brings the login information and inside it has a list called PerfisDeAcesso. How…
-
0
votes1
answer338
viewsPagseguro . Net Core Problem with . xml
I am implementing the payment with Pagseguro, however I am having problem in the execution of the following line: const bool isSandbox = true; EnvironmentConfiguration.ChangeEnvironment(isSandbox);…
-
0
votes2
answers163
viewsHow to make an ASP.NET Core Post API without using MVC?
I don’t work with ASP.NET Core Apis until I need it for a project written in C#. So I created with a standard project, with the following controller: [Route("api/[controller]")] [ApiController]…
-
0
votes1
answer119
viewsAdd multiple items in a single Session
That way I add an item to session var item = new FornecedorTipoFrete() { TipoFreteId = id, TipoFrete = new TipoFrete() { Descricao = tipofrete }, FornecedorId = (fornecedorID) };…
-
0
votes1
answer22
viewsProblems with select command of Line
The query worked she has 2 questions randomly with the 5 options each. The problem is that my select loads the view described below: public class QuestaoOpcaoModel { public int QuestaoId { get; set;…
-
0
votes1
answer867
viewsHow to have more than one GET request?
I want to be able to fetch my items by name and this function is also a get request only it already has other requests Get wanted to understand how to get as many as I want I understand the program…
-
0
votes1
answer544
viewsUpload files and other data from Angular 7 app to Asp Core Web Api 2.1.1
I’m having a problem uploading files using Angular 7 to API written in c# Asp Core 2.1. Searching the web I found several examples uploading the file only, but I need to upload the file and in the…
asp.net-core file-upload angular-7 asp.net-core-web-apiasked 5 years, 6 months ago Ricardo Alves 484 -
0
votes1
answer1891
viewsIIS with Asp.net core 2.0 - Error 502.5? IIS does not recognize Asp.net core 2.0
I have the project on the computer, and the same on the computer of the colleagues runs with the IIS. But on my pc, it does not run, gives the error HTTP Error 502.5 - Process Failure I generated…
-
0
votes1
answer61
viewsI would like to understand why when Modelstate is invalid, Viewmodel instantiation is "ignored" and form fields remain populated?
Follows my code: Subcategory Model public class SubCategoria { public int Id { get; set; } [Required(ErrorMessage = "Campo {0} é obrigatório")] [StringLength(200, ErrorMessage = "Campo {0} precisa…
-
0
votes1
answer102
viewsWhy does EF Core not load the information from the related Tables?
I will start by posting my data templates public class Anuncio { public int Id { get; set; } [Required] public string Descricao { get; set; } [Required] public TipoAnuncio TipoAnuncio { get; set; }…
-
0
votes1
answer63
viewsError trying to use Xunit
I’m trying to use XUnit to test my application, but I am getting this error at the time of injeção de dependência. I get the following error: Message: The following constructor Parameters Did not…
-
0
votes0
answers382
viewsMessage: The following constructor Parameters Did not have matching fixture data: Icompetitionservice competitionManager
I am getting the following error in my application Xunit, when using dependency injection: Message: The following constructor Parameters Did not have matching fixture data:Icompetitionservice…
-
0
votes1
answer39
viewsRewrite Data from an Object List in HTML
Hello, I have a List of objects that is being created in an Onget method and I need to get all the data from it to put in my html page, as I can recover this data? List<string> MenuPrincipal =…
-
0
votes0
answers142
viewsHow to return to previous View without losing data
I have a problem that I can’t solve, which is this. I have a screen that loads two simulated (each simulated has the questions and the radios Buttons that are the options). The simulated ones are…
-
0
votes1
answer35
viewsGenerate table of acquisitions that were performed Upload
I’m developing an ASP.NET Core application. And I was left with some questions, I was able to find some tutorials on how to upload pdf files, but now I need these files to be listed in a table for…
-
0
votes0
answers33
viewsHow to send an Android post to Asp.net Core?
I have an application in Asp.net Core that should receive a Post via android and I’m not getting. There is always an error on android that the page was not found. class of the object in the Asp that…
-
0
votes1
answer1013
viewsSqlexception: The INSERT statement conflicted with the FOREIGN KEY constraint
I have a 1-n employee relationship. I used the Entity Migrations to create the tables based on my models. I checked in the database and the tables were created with their respective PK and FK.…
-
0
votes1
answer68
viewsError trying to Edit PK and UK on ASP . NET Core
I would like to know how to manipulate the Unique Keys and Primary Keys with Entity Framework. Whenever I try to edit an attribute and pass the same value it had before, it returns me an error: "The…
asp.net entity-framework asp.net-core asp.net-identity entity-framework-coreasked 5 years, 5 months ago Snyp 13 -
0
votes1
answer484
viewsHow to resolve lambda expression conversion error of type Servicelifetime net core?
I am starting a very simple project with net core 2.2 and confronted myself with the following error: Cannot convert lambda expression to "Servicelifetime" type because it is not a delegated type…
-
0
votes3
answers62
viewsHow to choose the page URL (vice versa)
Hello, I’m developing a project with .NET Core Razor, and I have a file structure like this: When in the browser I go to the Menuprincipal page, the URL looks like this:…
-
0
votes1
answer47
viewsError mounting String with parameter . NET
So guys, I’m developing a project with . NET Core Razor, and I’m assembling a string there, as follows: string TotalInformacoes = ""; TotalInformacoes += (!String.IsNullOrEmpty(cl_1.Trim()) ?…