1

I have home object : id , FirstName, Lastname, Fees[ ]

Fees is object contain Amount description DueDate ...

home object include the Fees array

I have list of homes and every home has array/list from fees

I need to sort the fees depend on the Duedate in each object

for (int i = 0; i < homes.Length; i++)
  {
   homes[i].Fees = homes[i].Fees.OrderBy(si => si.DueDate).ToArray();
  }

Can I find one statement instead of four statements?


Just add Float on them so they get out of the "normal flow", or you could even use position absolute, if the text between the top image and them stays the same at all times...

For the width: you can simply make their width in % as well so you can say give the first one 80% and the second 20% using pseudo classes...

another possibility would be that you make different hard coded css's where you can easily define at what page width you want to use what css, for example something like this:

@media screen and (max-width: 400px) {
   .portrait:first {
       width: 85px;
   }

   .portrait:last {
       width: 105px;
   }
}  

and so on for every step on window size.

I Hope that helps :D

4

1 に答える 1

5

3 つのステートメントではなく 1 つのステートメントを見つけることはできますか?

それがあなたの目標になることはめったにありません。

でも; あなたはそれFeesが配列だと言います。その場合は、配列のクローンを作成するのではなく、その場でソートすることで、いくつかの作業を回避できます。

foreach(var home in homes) {
   Array.Sort(home.Fees, (x,y) => x.DueDate.CompareTo(y.DueDate));
}
于 2013-02-13T20:22:30.240 に答える