Guest User

Guest User

  • Tech Writer
  • 43
  • 7k

Break For each loop,

Apr 21 2021 7:02 AM
I have use nested loop 
foreach (var customEntity in customEntityResult.Items)
{
foreach (var customEntitys in result)
{
{
var model = customEntitys;
var blogPost = new BlogPostSummary();
blogPost.ShortDescription = customEntitys.ShortDescription;
blogPost.ThumbnailImageAsset = images.GetOrDefault(customEntitys.ThumbnailImageAssetId);
blogPost.FullPath = customEntitys.PageUrls.FirstOrDefault();
blogPosts.Add(blogPost);
}
}
}
I have get record by id 
1 categories-2 record
 
but here display 4 record 
 
how to break first foreach loop. 

Answers (1)