İyi Çalışmalar,
Fikret AKIN
VENGASOFT – Proje Müdürü
Tel: 0212 327 13 18
GSM: 0534 700 75 19
Personal web: www.fikretakin.com
Company web: www.vengasoft.com
Debugdiag ya da taskmgr ile dump al windbgde sosexle bak
--
You received this message because you are subscribed to the Google Groups "altdotnetturkiye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altdotnetturki...@googlegroups.com.
To post to this group, send email to altdotne...@googlegroups.com.
Visit this group at http://groups.google.com/group/altdotnetturkiye?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Yazdıklarından algıladığım kadarıyla problemin karakteristiği yüzünden bottleneck görünüyor. Query’ lerini elden geçirmeni tavsiye ediyorum.
--
İyi Çalışmalar,
Fikret AKIN
VENGASOFT – Proje Müdürü
Ilceler ilce = Ilceler.GetIlcelerByID(otel.IlceID.Value);
using (var otelEntity = new OtelEntities())
{
var list = (from i in otelEntity.Ilceler
//join o in otelEntity.Oteller on i.ID equals otel.IlceID into _oi
//from io in _oi.DefaultIfEmpty()
where i.SehirID == ilce.SehirID
select new
{
IlceID = i.ID,
IlceAdi = i.IlceAdi,
//OtelSayisi = i.Oteller.Count
//YorumSayisi = iotel.UyeYorumlariOtel.Count
}).ToList();
var list2 = list.OrderBy(x => Guid.NewGuid()).Take(5).ToList();
//for (int i = 0; i < 5; i++)
//{
// if (list2.FindAll(x => x.IlceID == list2[i].IlceID).Count > 1)
// {
// list2.Remove(list2[i]);
// list2.Add(list.OrderBy(x => Guid.NewGuid()).Take(1).FirstOrDefault());
// i--;
// }
//}
if (list2.Count > 0)
{
rptBolgeDigerAltBolgeler.DataSource = list2;
rptBolgeDigerAltBolgeler.DataBind();
}
}
var list = (from i in otelEntity.Ilceler
//join o in otelEntity.Oteller on i.ID equals otel.IlceID into _oi
//from io in _oi.DefaultIfEmpty()
where i.SehirID == ilce.SehirID
select new
{
IlceID = i.ID,
IlceAdi = i.IlceAdi,
//OtelSayisi = i.Oteller.Count
//YorumSayisi = iotel.UyeYorumlariOtel.Count
}).ToList(); // burda dbdeki tüm kayıtları çekiyorsun. bunu kaldırırsan sorunun çözülür.
var list2 = list.OrderBy(x => Guid.NewGuid()).Take(5).ToList(); //artık burası, listedeki tüm kayıtlardan 5 tanesini alıyor.
var list2 = list.OrderBy(x => Guid.NewGuid()).Take(5).ToList();
yukarıdaki order by hiç bir şey orderlamıyor gibi geldi bana.
İyi Çalışmalar,
Fikret AKIN
VENGASOFT – Proje Müdürü