Posts by user2929918 • 170 points
13 posts
-
0
votes1
answer26
viewsA: Unit Testing Entity Framework Core
What happens is that you seem to be actually going to the bank, which makes no sense, the test should be done to what refers to the method. If you don’t know, I suggest you make a mock of the…
-
0
votes1
answer56
viewsA: c# How to Apply Function to validate Cpf in an API?
The ideal in my opinion is that you implement an abstract class of service, for example "Baseservice", which will be inherited by all your services, this class will handle all notifications, and you…
-
0
votes1
answer20
viewsA: How to change the value of a textbox by another form? c#
You are trying to modify a thread control that is not the one it belongs to, try changing it as follows: private void BTNok_Click(object sender, EventArgs e) { Invoke((MethodInvoker)delegate {…
c#answered user2929918 170 -
1
votes1
answer22
viewsA: The type of entity requires a primary key to be defined
you need to instantiate your configuration class as follows: protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.ApplyConfiguration(new PessoaConfig());…
-
1
votes1
answer17
viewsA: Why doesn’t my Progressbar increase values?
In this case you are trying to modify controls within a thread that is not what it belongs to. To solve you can involve these controls as follows: Invoke((MethodInvoker)delegate { labelX.Text =…
-
1
votes0
answers263
viewsQ: Bulk C# and Sql Server NFE xml import
Good morning! I have an application with the following features: Windows Forms, C# Visual Studio Community 2019 Sql Server Express Windows 10 Pro About: I created the application in order to import…
-
0
votes1
answer92
viewsQ: How to convert XML field to decimal
When reading an Nfe XML I read fields that in my system are decimal, for example qCom (Quantity), vUnCom (Unit Value) and vProd (Product Value), but the XML file uses the point as decimal separator,…
-
2
votes1
answer113
viewsQ: Dependency Injection and Generic Repository Windows Forms C#
I have a windows Forms application where I am trying to use dependency injection for some services, for this I did the following configuration initially in Program.Cs I register the services: static…
-
2
votes0
answers189
viewsQ: Generic Repository with Dapper
I’m doing a test application where I want to see performance and learn about creating a generic repository with Dapper, well I have some experience when creating a generic repository, but using EF6,…
-
0
votes1
answer447
viewsQ: Access Combobox Selecteditem Windows Forms C#
I put the items inside the combobox as follows: cmbSituacao.DisplayMember = "Text"; cmbSituacao.ValueMember = "Value"; cmbSituacao.Items.Add(new {Text = "TODOS", Value = "000000"}); foreach(var sit…
-
4
votes1
answer219
viewsQ: Query Return - Generic Entity Framework Repository
I have a generic repository and I realized that it is taking too long to return a query with the selection of some columns of my database, the Query() method is as follows: public IList<T>…
-
0
votes1
answer853
viewsA: Could not find android.jar for API Level 25
apparently only missing the platform for which your project was created, so you must install the correct version. Go to Tools>> Android>>Android SDK Manager, then select the option of…
-
0
votes1
answer388
viewsQ: Create registration pattern with C# UI repository
I created in my system a repository with EF6, each registration I do access the methods of my repository to commit the actions I need (Insert, Delete etc...). The problem is that my system is very…