Questions tagged as 'c#'

1
answer

Simple Injector + UoW + DDD + Multiple Contexts + Entity Framework

I need to know how to apply IoC for two contexts. The scenario is as follows: I have a Layer called Core (allocates classes that I can reuse in other layers), where I put the interface of IDbContext, IUnitOfWork and UnitOfWork (among ot...
asked by 03.12.2016 / 20:58
1
answer

AddOrUpdate - use array as parameter

I'm running tests with the Entity Framework and I had a problem putting a array as a parameter. Is this behavior normal? If yes, what name? It works List<Product> product = new List<Product>() var p = product...
asked by 04.11.2015 / 15:32
2
answers

Catching elements around a selected array

The idea is to create an array of integers with the amount of rows and columns defined by the user. Then an existing value in the array must be entered and the program should return the values immediately to the left, right, above and below the...
asked by 30.08.2018 / 16:26
2
answers

How to do a row count (SELECT COUNT) in Linq

How to make a count of records that a query would return in Linq (Entity Framework) in C #? The equivalent in SQL is to make a SELECT COUNT(*) . Note that I want to receive the direct count of records, just like a SELECT COUNT (*) would...
asked by 21.03.2014 / 15:22
3
answers

CheckboxList in ASP.NET MVC

I need to create a checkboxlist on my page using MVC (Razor). I noticed that there is no Html helper of type Html.CheckboxlistFor or something like that. Someone has some example of how I could do this. If possible, what would the code look l...
asked by 17.02.2014 / 21:11
3
answers

Field date 01/01/0001

I'm having a project
asked by 08.04.2014 / 15:30
2
answers

Memory Error When Inserting Millions of Records Using Entity Framework

I'm using the Entity Framework to do insert and update thousands of records. At first it was slow, but after putting the code below it improved the speed. db.Configuration.AutoDetectChangesEnabled = false; db.Configuration.ValidateOnSaveE...
asked by 04.09.2015 / 15:14
2
answers

How to access next and previous record with C # using Entity Framework

I'm developing a Windows Form application, with Entity Framework 6 + MySQL. As is common in systems, I have in each form navigation buttons (First Record, Previous Record, Next Record, Last Record) The question: Is there any definite synta...
asked by 02.08.2015 / 02:54
2
answers

Theoretical doubt - Interface, single responsibility

Presentation: I created a class fotografia.cs that should be responsible for: Calculate the angle of view of the lens; Lens zoom (in mm) Receive the cut factor (value multiplied by the zoom of the lens shows the actual lens value)...
asked by 24.03.2014 / 14:52
2
answers

How do I get a random string from a list of strings?

Code: nomes = new string[5]; nomes[0] = "José"; nomes[1] = "Carlos"; nomes[2] = "João"; nomes[3] = "Miriam"; nomes[4] = "Estela"; I put an array, but it does not have to be array, it can be with list or something else that gets fas...
asked by 30.05.2014 / 15:46