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
zeeshan akram
1.4k
325
18k
How to return multiple object in this senerio.
Mar 2 2020 12:49 AM
Anyone can suggest me How to return these to objects.
public
ProductViewModel GetProductByID(
int
ID) {
try
{
var product = (from p
in
_db.Products where p.ProductID == ID
select
new
{
p.PName,
p.PDescription,
p.Model,
p.Condition,
p.UnitPrice,
p.ManificturedPrice,
p.Discount,
p.UnitWeight,
p.UnitInStock
}).FirstOrDefault();
var productDetail = (from pd
in
_db.ProductDetails join b
in
_db.Products on pd.ProductID equals b.ProductID where pd.ProductID == ID select
new
{
pd.ProductID,
pd.OS,
pd.ProcessorType,
pd.RAM,
pd.ScreenSize,
pd.TouchScreen,
pd.BatteryLife,
pd.Camera
}).ToList();
return
new
{
product,
productDetail
};
}
Reply
Answers (
4
)
What is server less application in Azure ?
Best Template for Register,video upload,user login,register