entity framework nested select queries

I have a SQL query and I should use it in Entity Framework. I'm new in Entity and I don't know how I can do that. My query is:

SELECT EKIP,
       COUNT (SAGLA) AS KPISAYISI
FROM
  (SELECT M.APPLICATIONID AS ORTAM,
          MNAME AS SERVIS,
          sum(AVAIL*HIT)/SUM(HIT) AS SAGLA,
          SUM(HIT) AS CAGRI ,

     (SELECT DOMAINNAME
      FROM SOAGOVERNANCE_SERVICE D
      WHERE D.NAME=m.MNAME
        AND D.APPLICATIONID=m.APPLICATIONID) AS EKIP
   FROM SOAGOVERNANCE_METRICLOG m
   WHERE MDATE BETWEEN '2013-01-01 01:00:00' AND '2013-02-01 01:00:00'
     AND MTYPE='SERVICE'
   GROUP BY APPLICATIONID,
            MNAME) S
WHERE S.CAGRI > 3
  AND S.SAGLA<90
GROUP BY EKIP
ORDER BY EKIP

Answers


The simplest way is creating a sql view with you query. And then create entity on view.

Or you want full query in entity?


Need Your Help

Get arguments of objective-c method by index

objective-c c

I know that objective-c methods are actually c function, and that the first two arguments are self and _cmd. I'm trying to get the remaining arguments as an array (including or excluding, self and ...

Splitting skips half a content when splitting by @

java android regex split

I have an android application that requests data from a text file. when I try to separate the data and initialize classes, I have serious trouble because half the data after splitting is missing. The