TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ramesh p
NA
27
812
How to get products from list based on quantity and max
Oct 21 2019 1:01 AM
Hi,
I have list like List<promoptionproducts>.This list contains the objects.
PromoptionProducts
Public Class PromotionProducts
{
Public
long
int
Public
long
ProductId{
get
;
set
;}
public
long
qty{
get
;
set
;}
public
decimal
price{
get
;
set
;}
Public
int
max {
get
;
set
;}
}
Case1:
List<PromoptionProducts> promotionproduct=
new
List<PromoptionProducts>(
new
promotionproduct({Id=1,productId=101,qty=4,price=25,max=3 });
I want to get the qty of products from list based on max that means I want 3qtyproducts from the list based on 3.
List<PromoptionProducts> promotionproduct=
new
List<PromoptionProducts>(
new
promotionproduct({Id=1,productId=101,qty=2,price=25,max=3 },
new
promotionproduct({Id=2,productId=102,qty=2,price=35,max=3 });
I want to get the qty of products from list based on max that means I want 3 qty products from the list based on 3.
While using linq queries.
Please help me.
Thank you.
Reply
Answers (
2
)
Query issue join and group By
Difference B/W IQueryable and IEnumerable