Questions tagged as 'linq'

1
answer

Show character frequency in a string

Again here, I'm trying to print on screen the relative frequency of the character that is most often found in a chain. In order to calculate the relative frequency, the formula is as follows: fr = Cantidad de veces que aparece el caracter / Ca...
asked by 21.11.2017 / 14:22
1
answer

How to optimize search for duplicate byte arrays in C #?

I have the following list of Objects: List<PacketData> packetList = new List<PacketData>(); public class PacketData{ public DateTime timestamp {get; set;} public byte[] data {get; set;} public bool isDuplicated {get; s...
asked by 10.03.2017 / 03:16
2
answers

How to make an if in linq

How can I make a if within Linq for example I have the code: lstParentLines = dbContext.Packages.Select(p => new SummaryViewModel { Id = p.Id, Package = p.Name, CurrentTotal = budgMonthDetails.Where(bm => bm.Co...
asked by 30.09.2016 / 20:19
2
answers

When saving multiple photos, I get the error Validation failed for one or more entities. See 'EntityValidationErrors' property for more details

I have a problem saving multiple photos, I get the error Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. I have a modal where I keep multiple photos: tables: PHOTO -NOTICIA_FOTO (inter...
asked by 23.01.2016 / 03:08
1
answer

List c # help list distribution

I am new to the list development, I have a query: Assuming I have a list with fields id, name, store, code. and the code is repeated for example 001,002,003,001,001 how to divide the list into 2. one for the repeated codes and another for the no...
asked by 26.11.2018 / 02:51
3
answers

Convert sql to Linq

Select Curso.* from Curso left join AlumnoCurso on Curso.id = AlumnoCurso.Curso_id where AlumnoCurso.Curso_id is null Friends I have this query but I have not managed to know how to pass it to linq or a lambda expression Please help me? At...
asked by 26.07.2016 / 18:01
1
answer

How to update the properties of the elements of a list using Linq?

Good day community, there is a common scenario and I have not seen any similar question, so I will share the solution right away. Basically, we have a list of elements and we want to update one particular property using Linq . using S...
asked by 09.06.2018 / 00:12
2
answers

Convert DbSetT to different data type in EF - Linq

I'm working on an expression Linq in which I get an object of DBContext , and I want to convert it into an object of ViewModel My ViewModel receives as parameter an object obtained from DBContext to work the...
asked by 27.06.2018 / 14:29
1
answer

Compare values obtained from the same query

I'm new to C #, I'm doing a web application in VisualStudio 2015, with ASP.NET MVC5 and EF6. I need to compare the values that a linq query throws at me, normally I would do it with a two for , one within the other, although maybe they can...
asked by 15.03.2018 / 15:18
1
answer

Filter in DataGridView c #

I have a DataGridView whose DataSource is a DataTable with an already defined schema, it has 6 columns, Id , Computer_name , Serial , ... What I want to do is filter this DataGridView and show me only the rows that meet my conditi...
asked by 16.11.2017 / 01:31