Perform sorting by a given field of a given table

Asked

Viewed 35 times

1

I have the following syntax

The instruction below perform sorting by field Lot Number table Lot

var lvmLotes = db.Lotes.Tolist(). Where(x => x.DataAbate.Date == Search). Orderby(x => x.Numerolote);

Base de dados indicando campo que atualmente ordena e campo que quero que ordene

I need to change the field that sorts the list, as I do to sort through the field Initial Sequence table Gender

  • What do you mean? You need that at the time of the visualization, the sequence comes before the Dataabate?

  • This that Order by Dataabate and also by Incial Sequence, at the time of visualization, in the Actionresult -- public Actionresult Index(Datetime); in the Actionresult View(loteViewModel)? Research)

  • Add Sequential to your code. Have you tried?

  • I already tried and the lambda does not have access, and so it seems that I have to access Lotegenero after Genero and then yes you have access to the Sequential field

  • @Mariaclara I already tried to add Sequenciainicial, var lvmLotes = db.Lotes.Tolist(). Where(x => x.DataAbate.Date == Search). Orderby(x => x.Numerolot). Thenby(c => c.Sequential); but it did not work

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.