Posts by Fabri Damazio • 1,015 points
46 posts
-
0
votes1
answer71
viewsA: How to add only the Dlls needed for an (-self-contained) application?
It’s completely normal and see why according to the Microsoft documentation: Self-contained implantation. Unlike FDD, SCD (implantation self-contained) is not based on the presence of shared…
.net-coreanswered Fabri Damazio 1,015 -
1
votes1
answer616
viewsA: Version incompatibility 'Microsoft.AspNetCore.App'
The . NET Core framework allows different versions to be installed and run on the same machine. This is known as "side-by-side installations". To know all versions installed on your machine you can…
asp.net-coreanswered Fabri Damazio 1,015 -
0
votes4
answers243
viewsA: Problems saving an already edited entity in the Entity framework core context
When you give the get in your entity EF Core starts tracking it. When it returns modified it continues tracking and already knows that it is modified. In your Edit method when you attach it gets…
-
3
votes1
answer62
viewsA: Asp.Net Core does not support System.Data.Entity.Spatial.Dbgeography?
You can use from the version of Ef Core 2.2 For this you need to install the following Nuget packages if using Sql Server: Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite…
-
0
votes2
answers695
viewsA: Command to perform the Down of a migration
To reverse Migrations you need to perform 3 steps: first step - To revert to a particular Migration: Update-Database <nome-da-migration-escolhida> second step - Delete the Migrations you do…
-
2
votes1
answer772
viewsA: Paging library for . Net Core
There is no no official library making pagination. There are Nuget packages that do this like the AspNetCore.Mvc.Paging You can search for other packages on the site https://www.nuget.org/ In the…
-
1
votes1
answer37
viewsA: How to configure the Incrementby of a Postgre Id field using the Entity Framework Core
The 10 in 10 sequence is the default when you are using ForNpgsqlUseSequenceHiLo. You can create your custom sequence 1 in 1 and report as below: modelBuilder.HasSequence("minha_sequencia", b =>…
-
0
votes1
answer250
viewsA: Alert on condition in Controller Asp Net MVC
You can check the modelstate or anything else you want at view and call javascript Alert @if(!string.IsNullOrEmpty(ModelState.isValid)) { <script>alert("Mensagem de erro");</script> }…
-
4
votes1
answer823
viewsA: What is the purpose of Concurrencystamp and Securitystamp in ASP.NET Identity?
Concurrencystamp represents the current status of the data in the repository and this is necessary to avoid competition problems. Example: An admin opens a user’s registration to edit their email…
-
1
votes1
answer1131
viewsA: Use Ilogger with . Net Core 2
You can use Serilog. With it you have several options where to register your log. Install the following Nuget packages: Serilog.AspNetCore, Serilog.Sinks.Console and Serilog.Sinks.File Configure…
-
1
votes2
answers93
viewsA: Method to Receive Generic Values
Agnaldo there are several ways to do this. In one of them you can create an interface and make all your Collections implement them, for example IMinhaInterface public interface IMinhaInterface {…
-
1
votes1
answer565
viewsA: Injection of dependency Generics<T>
You can use the typeof: services.Addscoped(typeof(Irepositorymongo<>), typeof(Repositorymongo<>));
-
3
votes1
answer1458
viewsA: Product is a namespace but is used as a type
You have a namespace in your project called product, as well as your class. Probably some folder called product you added. Change the name of the folder to Products in the plural and change the…
-
1
votes1
answer68
viewsA: Does not display data on the Web Api Asp.net mvc screen
Exchange the ReadAsAsyncfor ReadAsStringAsync : empregadoLista = response.Content.ReadAsStringAsync<IEnumerable<MvcEmpregadosModel>>().Result; The method ReadAsAsync will try to read…
-
0
votes1
answer220
viewsA: Get the value of custom attributes in aspnet-Identity . NET CORE 2.0
To get all user information you must use: var user = await _userManager.GetUserAsync(User); Then just use user.NuCPF And yes, he’s going to the bank to get the information. OBS: change the name of…
-
2
votes1
answer357
viewsA: What is "Asp-fallback" for in ASP.NET MVC, Razor Pages?
When we are developing a web application one of the biggest concerns is the loading time of our application. One of the optimization techniques used is to use the so-called CDN for the most known…
-
0
votes2
answers736
viewsA: System.IO.Ioexception: The user name or password is incorrect
This happens because the username in which the app is running on the production machine does not have access on the other server, giving Exception. Probably ran locally because the user running the…
-
0
votes1
answer216
viewsA: Doubt in Asp.Net Core Identity’s Verifyusertokenasync method
It comes from configuring your Identity in your startup.Cs: // ASP.NET Core Identity Configuration services.AddIdentity<ApplicationUser, IdentityRole>()…
-
1
votes2
answers180
viewsA: How to load a number list into a TXT file for a C#list?
Using List<string[]> lista = File.ReadLines("NomeDoArquivo.txt") .Select(line => line.Split('|')) .ToList(); File.ReadLines("NomeDoArquivo.txt") to read the file line by line .Select(line…
-
3
votes2
answers663
viewsA: Where to create a Helpers layer?
Taking into account that your project already has these layers and you wanted to implement some helpers, one way to keep everything organized and respecting the layers would be to let the helper…
-
0
votes3
answers973
viewsA: Websocket - c# . NET
Yes it is possible to create a websocket using console application. It is created using C# itself and you can find an example code in this article on official documentation. This MDN link has a…
-
2
votes1
answer1165
viewsA: Angular Format-date with date shortened one day
That’s a Timezone problem. You can use ng-options to solve this way: ng-model-options="{timezone: 'UTC'}" Or still: ng-model-options="{timezone: timezone}" And on the controller: $scope.timezone =…
-
3
votes2
answers99
viewsA: Stackoverflowexception in c# by Linux visual studio code
Your problem is here: public string user { get { return this.user; } set { this.user = user; } } You are referring to the property name and not to the private variable name, which results in an…
-
0
votes1
answer72
viewsA: Migrations Asp Net MVC
When you do not specify a connection string, the Entity Framework creates an internally pointed string for your Localdb and with the database name equal to yours DbContext Search your…
-
0
votes1
answer269
viewsA: Put Asp Net MVC Identity validation
To register a user, Identity in aspnet mvc 5 uses the class Registerviewmodel that’s in the archive Accountviewmodels.Cs inside the briefcase Models. public class RegisterViewModel { [Required]…
-
0
votes1
answer83
viewsA: Seed Method for Many-to-Many Relationships
You have to list your products and subcategories in the Seed method by adding the subcategories in the product list var produto = new Produto(); var subcategoria = new SubCategoria():…
-
1
votes1
answer75
viewsA: EF 6 - Migrations does not reflect changes in entities
Perform a -force for your last Migration before your automatic Migration.
-
0
votes3
answers1019
viewsA: Return Notfound() Web Api c#
You’ll have to create your custom message separately if you want it to return. Here explains how to do…
-
1
votes1
answer405
viewsA: Datatable sorting problem in the Brazilian standard of numerals
You need to take into account the culture that is being used when ordering anything. In the case of Datatables here are the instructions for you to sort taking into account the culture used.…
-
0
votes2
answers153
viewsA: Doubt about code in C
Case 1 You have to print the message on the screen to type name. Then use the scanf to receive the result. Then print on the screen the message to type price. Then use scanf to receive the result.…
canswered Fabri Damazio 1,015 -
1
votes2
answers42
viewsA: Using object property when declaring it in javascript
Your code would look like below. You create the object and decalara sseu method inside it that takes as a parameter which element you want to change. Then outside the object you call the method and…
-
1
votes1
answer447
viewsA: Backslash on links before the file name
From what I read in the HTML Standard documentation the src attribute of the element has to be a "Potentially empty URL surrounded by valid spaces" (Valid non-empty URL potentially surrounded by…
htmlanswered Fabri Damazio 1,015 -
1
votes4
answers4566
viewsA: How do I update my data in the table using the Entityframework?
You use attach only to attach an entity to the context that is not yet being monitored by it. Since your entity is already in context and you are modifying its properties, you can save the changes…
-
5
votes1
answer318
viewsA: Entitystate - How it works
To understand how Entitystate works you have to understand the life cycle of the entity (Entity Lifecycle). Any CRUD operation is done through the context (context) we created from the database.…
.netanswered Fabri Damazio 1,015 -
0
votes2
answers215
viewsA: Apply the CSS of a child of element A to another element B
If your question is right just do this the Dots id will get the child class style. $( "#dots" ).addClass( "outra" ); .filho, .outra { color:red; } <script…
-
0
votes3
answers376
viewsA: multiply div s repeat loop co div s
Look at the demo I made. Increase the result window to see JSFIDDLE Using Jquery and Bootstrap // Aqui comeca o for each <div class="col-md-3 channel"> //php echo vai aqui </div> //Aqui…
-
6
votes1
answer505
viewsA: Full Calendar does not respect end date
If you look at documentation will see that the last day (end) is EXCLUSIVE Which means the end day doesn’t count. For example if your event ends Monday, the end date should be Tuesday at 00:00.00 so…
-
1
votes1
answer821
viewsA: how to create a block to display c++/java code in HTML/CSS?
I recommend using the Highlight.js. It works in over 174 languages and 77 styles. You can download it and use only add in the page HEAD <link rel="stylesheet"…
-
1
votes3
answers71
viewsA: Difference between Immediate Child and First-Child?
Immediate Child Selects an element that is child DIRECT other element. For example div > span Select only the first and third span that are direct children. <div> <span>Essa é filha…
-
0
votes1
answer98
viewsA: Show row by row in a table
Here’s a functional example. Just adapt your PHP. $( document ).ready(function() { var $form = $('.form'); var $table = $('.updatetable'); $table.on('click', 'button', function() { var row =…
-
0
votes1
answer64
viewsA: Send Post with form data through Jquery
As I do not know the data that has the table I will give you a generic solution to apply. Let’s assume that the table has the column Id and other content. So the same way you got the ID you get the…
-
4
votes1
answer1464
viewsA: Generate 4-digit aléatory numbers [0000-9999]
function pad(str, length) { const resto = length - String(str).length; return '0'.repeat(resto > 0 ? resto : '0') + str; } var resultados =5040; var maximo = 9999; var arr = []; while(arr.length…
javascriptanswered Fabri Damazio 1,015 -
0
votes2
answers35
viewsA: enable Borders when checkbox is enabled
.border { display:block; width:200px; height:100px; background-color:grey; position: relative; } label { width: 100%; height: 100%; display: block; } img{ margin-left: 20px; } input[type="radio"] {…
-
0
votes1
answer104
viewsA: Is it more correct to use the Master-Detail concept?
Marcelo you can use Viewmodel Pattern. In the case of using information from two Models in the same view you can create a Viewmodel that contains the two or more Models. Viewmodel should have no…
-
1
votes1
answer134
viewsA: What is the best way to send action(form) or jquery Submit data?
There is no better way but in the case of sending a form it is prudent to use the action form because if the user has any error regarding Javascript (eg javascript disabled) it will be impossible to…
-
2
votes1
answer126
viewsA: Customize password characters in the password field
You cannot change the asterisks that mask the default password field. Also you should not even do this because it is the look and Feel standard to mask passwords and you may actually end up…