I want to group the below query by GetSetDomainName
and select the row which has the maximum GetSetKalanGun
.In other words, I am trying to get the row with the maximum KALANGUN among those which have the same DOMAINNAME.
var kayitlar3 = (
from rows in islemDetayKayitListesi
select new
{
KAYITNO = rows.GetSetKayitNo,
HESAPADI = rows.GetSetHesapAdi,
URUNNO = rows.GetSetUrunNo,
URUNADI = rows.GetSetUrunAdi,
URUNMIKTAR = rows.GetSetUrunMiktar,
ISLEMTARIHI = rows.GetSetIslemTarihi,
HIZMETDURUMU = rows.GetSetHizmetDurumu,
TOPLAMTUTAR = rows.GetSetToplamTutar,
HIZMETBASLANGICTARIHI = rows.GetSetHizmetBaslangicTarihi,
HIZMETBITISTARIHI = rows.GetSetHizmetBitisTarihi,
KALANGUN = rows.GetSetKalanGun
DOMAINNAME = rows.GetSetDomainName,
SIPARISDURUMU = rows.GetSetSiparisDurumu
}).AsQueryable();
This is what I get
KAYITNO DOMAINNAME KALANGUN
1 asdf.com 30
2 domnam.com 172
3 asdf.com 40
4 xyz.com 350
This is what I want
KAYITNO DOMAINNAME KALANGUN
2 domnam.com 172
3 asdf.com 40
4 xyz.com 350
var islemDetayKayitListesi = new List<IslemDetayKayit>();
islemDetayKayitListesi
get filled with a foreach loop, with no problem
And that is what IslemDetayKayit
looks like
public class IslemDetayKayit
{
public int GetSetKayitNo { get; set; }
public string GetSetHesapAdi { get; set; }
public string GetSetUrunNo { get; set; }
public string GetSetUrunAdi { get; set; }
public double GetSetUrunMiktar { get; set; }
public string GetSetIslemTarihi { get; set; }
public string GetSetHizmetDurumu { get; set; }
public string GetSetToplamTutar { get; set; }
public string GetSetHizmetBaslangicTarihi { get; set; }
public string GetSetHizmetBitisTarihi { get; set; }
public int GetSetKalanGun { get; set; }
public string GetSetSiparisDurumu { get; set; }
public string GetSetDomainName { get; set; }
}
EDIT : I figured out that there was some other problem in my code, and corrected it.After that all the answer I had to this question works.Thank you for helping and teaching me new things.