Posts by Rafael • 496 points
34 posts
-
1
votes2
answers119
viewsA: SQL connection to Dapper/Asp.net Core
If you look at the Asp.net core source code in https://github.com/aspnet/Extensions/blob/master/src/Configuration/Config.Abstractions/src/ConfigurationExtensions.cs You may notice that the extension…
-
0
votes1
answer83
viewsA: Pagemodel.Page() is a method, which is not Valid in the Given context
Scriptmanager was traditionally using Webforms and Updatepanel to perform ajax and partial render requests, in ASP.NET Core you will no longer have that (I believe you will not even be migrated). In…
-
0
votes1
answer544
viewsA: Upload files and other data from Angular 7 app to Asp Core Web Api 2.1.1
I use ng2-file-upload (https://github.com/valor-software/ng2-file-upload), but I believe you need to put everything in the same model, see my example: Uploaded the file and additional data (using…
-
3
votes1
answer147
viewsA: controller with the same name (home) in different areas
To avoid ambiguity, you must tick the area in the controller using the annotation "Area": [Area("Paciente")] public class HomeController : Controller { // GET: /<controller>/ public…
-
1
votes1
answer124
viewsA: I cannot perform a Redirecttoaction for an Area
I’ll show you what I did to work, check on your project: First add route in startup: app.UseMvc(routes => { routes.MapRoute( name: "MinhasAreas", template:…
-
1
votes1
answer160
viewsA: Get String (.net core for Jquery) value
Hello, you can change the action to return what you need, probably Antiforerytoken() will also be a problem since it is turned on as default and your calls will return error 400. If you don’t use…
-
0
votes1
answer281
views -
2
votes1
answer338
viewsA: Pagseguro . Net Core Problem with . xml
I did an ASP.NET Core project and added the UOL.Pagseguro project, I made the following modifications: In the UOL.Pagseguro project I modified the urlXmlConfiguration for: private static string…
-
0
votes2
answers108
viewsA: Check if call came from API (.Net Core) or MVC
First you need to install Configurationmanager through Nuget on ASP.NET Core (considering that you are using 2.0, previous to this has no support): Install-Package…
-
0
votes1
answer327
viewsA: How to create a list of Roles in Claim using ASP.NET Core
You need to add individually, as I use the Authorize of the Asp.net core itself I do so, it is responsible to serialize it internally: claims.AddRange(roles.Select(role => new…
-
0
votes1
answer112
viewsA: Error 404 run angular Asp.net core
Please try adding the route to Index.html so that Asp.net core can pass control to the angular: Use inside Configure (Startup): app.Use(async (context, next) => { await next(); // Rewrite request…
-
1
votes1
answer83
viewsA: Dependency injection and coupling - how wrong is this?
I don’t see a problem, some coupling will need to have. The important thing is that the domain has no reference. You could in the case, inject also the Departamentservice and apply the Unitofwork…
-
0
votes1
answer243
viewsA: Problems passing 3 parameters via AJAX request -Asp.net Core MVC
By your AJAX call, you are sent something like this: public class PessoaDTO { public PessoaContatoViewModel PessoaContatoViewModel { get; set; } public int FormaContatoIdChange { get; set; } public…
-
0
votes1
answer222
viewsA: Migration does not recognize Context
I think you’re confusing it with the parameter. The right thing would be: Add-Migration --context MuoContext Initial or Add-Migration -c MuoContext Initial But if your application only has 1 context…
-
0
votes2
answers194
viewsA: Entity Endereco Compatilhada
Yes, the address class will use the Valueobject convention in a directory within your domain. However, it would be correct for you to persist (database) in separate and related tables in your…
-
0
votes1
answer56
viewsA: Includes in Entity Framework Core
Your second code uses Result, so you must be using a return Task. As it works asynchronously, your API is returning before all queries and the object’s Binds are completed. Try to add the AWAIT…
-
1
votes1
answer42
viewsA: Error trying to install Ntoastnotify package by Nuget
You have two alternatives: Install version of Ntoastnotify 5.0.8 compatible with ASP.NET Core 2.1 Install-Package Ntoastnotify -Version 5.0.8 Update your application to use ASP.NET Core 2.2 Example…
-
0
votes1
answer35
viewsA: Bootstrap application in ASP.NET Core 2
Hello, Panel has been replaced for Card in version 4: https://getbootstrap.com/docs/4.3/migration/#panels Following are examples of use: https://getbootstrap.com/docs/4.3/components/card/…
-
2
votes1
answer288
viewsA: Return View without losing data
You need to return the same as your LSE, passing the viewmodel back to view: return View(ambienteViewModel); So the viewmodel will continue to be filled and the fields will be reloaded. Now if you…
-
0
votes1
answer244
viewsA: Personal Field Login to Identity
When you add Identity: "services.Addidentity", you can pass your custom classes, for example, to the user: services.AddIdentity<UsuarioCustomizado>(); Custom User must inherit the Identityuser…
-
1
votes1
answer175
viewsA: How to configure user downtime in Asp.Net Core?
Hello, for the refresh to work you need to set another setting within the call options Slidingexpiration for true. Now to ensure that these settings are not overwritten you will need to put your…
-
1
votes1
answer123
viewsA: Implementarr Asp.net core Identity 2.1 in a databasefirst project with two contexts
You can inherit Identitydbcontext from the main application context, example: public class ApplicationDbContext: IdentityDbContext<ApplicationUser> { public…
asp.net-coreanswered Rafael 496 -
0
votes1
answer71
viewsA: Inject multiple Idbconnection into Asp.Net core
all right? You can use an EF Core extension, in which case you need to define your contexts by inheriting from Dbcontext: Use like this: services.AddDbContext<DbContext1>(options => {…
-
1
votes1
answer115
viewsA: Difficulty with filter in Angularjs
the third parameter of the filter is Command, it receives a Function and so you can make the condition you want: <!DOCTYPE html> <html> <head> <link rel="stylesheet"…
-
1
votes1
answer78
viewsA: Asp net Identity
I believe the biggest difference is the way it is configured and injected into the application. You can learn how to use it through the microsoft website itself: ASP.NET Core Identity Also has a…
-
0
votes2
answers48
viewsA: Entity framework 6.2.0 + Find
You can simply reset the time of the Periodo.Date cut-off date or create an extended function: DateTime date = new DateTime(Periodo.Date.Year, Periodo.Date.Month, Periodo.Date.Day, 0,0,0); Find(x…
-
0
votes1
answer915
viewsA: How to request via c#? Webrequest vs Httpclient
Httpclient is the most current class to be used (as of 4.5), including in ASP.NET Core (which I use) it is possible to apply resilience behaviors in micro-services using Polly This class allows the…
-
0
votes1
answer77
viewsA: How to create Oauth2 Rediret URI using Dropbox API in C#?
there is an example application in the Dropbox github to show the use of SDK in the application console, there are also other examples for MVC and for Windows 10 Apps: Dropbox_simpletest Apparently…
-
0
votes1
answer94
viewsA: Referenceerror: $ is not defined
Put that at the end of the View in that order: --omitido @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) <script…
-
0
votes3
answers169
viewsA: Modal doesn’t close on the Electron, how to fix it?
I don’t work with Vue, but I found a code working, very simple: Jsfiddle In any case, there is already a bootstrap library for Vue: Bootstrap 4 Vue I hope I’ve helped!…
-
0
votes1
answer204
viewsA: Control Dapper Transaction with Simplecrud / Error: Enlisting in Ambient transactions is not supported
Simplecrud accepts the transaction as a parameter in CUD methods, but it comes from _dbConnection, to control this you will need to implement the Unitofwork Pattern, it will centralize the…
-
1
votes1
answer36
viewsA: Customizing External Identity login on custom buttons
Hello, You first need to associate the schema to each button and each submit to an action and as a result generate a Challenge to the specific Provider (google, facebook etc.) Button Example: (I’m…
asp.net-coreanswered Rafael 496 -
0
votes1
answer362
viewsA: How to customize Asp.Net Core 2.1 login screen
Friend, I didn’t understand your question very well, but you can do the following: In the open project, right-click on it, then Add and then New Scaffolded Item, as below: 2. On the new screen,…
-
0
votes2
answers224
viewsA: Exception treatment not working
In Asp.net core you treat this in "Filters". Create a class that implements the "Iexceptionfilter" interface. In it you can use the context to perform any treatment, you can also normally inject…