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
Ravi 1001
NA
42
669
Custom Linq query for Entity Framework & ASP.NET MVC app
May 13 2020 2:42 AM
I have been working on an ASP.NET MVC app using Entity Framework. Also, it's my first time developing an ASP.NET MVC app. I have been struggling (close to a month of trying and googling) to write a linq query to display results in jQuery datatable for the below SQL query. It involves various left joins and some columns have null values. It would be great if someone could help me out on this. There are 3 databases as below
Assets
Category
Term
SQL QUERY
SELECT
Asset.
Name
AS
Name
, Asset.Type
AS
Type, Asset.Parent_Asset
AS
"Parent Asset"
, Cat.Category
AS
Category, Cat.Parent_Category
AS
"Parent Category"
,
T.BUSINESS_TERM
AS
"Business Term"
,
T.SHORT_DESCRIPTION
AS
Description
FROM
(
SELECT
CH.DISPLAY
AS
Name
, CH.TYPE
AS
Type, PA.DISPLAY
AS
Parent_Asset, CH.CATEGORY_INT_ID
FROM
[Metadata].[dbo].[Asset] CH
LEFT
JOIN
[Metadata].[dbo].[Asset] PA
ON
PA.PARENT_ASSET_ID = CH.ASSET_INT_ID) Asset
LEFT
JOIN
(
SELECT
CH.DISPLAY
AS
Category, PA.DISPLAY
AS
Parent_Category, CH.CATEGORY_INT_ID
AS
Category_Id
FROM
[METADATA].[dbo].[Category] CH
LEFT
JOIN
[METADATA].[dbo].[Category] PA
ON
PA.PARENT_CATEGORY_ID = CH.CATEGORY_INT_ID) Cat
ON
Asset.CATEGORY_INT_ID = Cat.Category_Id
LEFT
JOIN
[Metadata].[dbo].[Term] T
ON
T.CATEGORY_INT_ID = Cat.Category_Id
Reply
Answers (
1
)
How to create table definition using NUGET command?
Authentication in ASP.NET MVC 5 application using ASP.NET id