Improve speed of LINQ query
First lets split up the query so we can read it:

var alertList = from alerts in _db.Alerts.AsNoTracking()
                where alerts.AlertID &gt;= Id.AlertID &amp;&amp; alerts.DataWystapienia &gt;Id.DataWystapienia
                select new MyAlerts { AlertID = alerts.AlertID, DataWystapienia = alerts.DataWystapienia, Message = alerts.Message };

var subAlertList = from subAlerts in _db.SubAlerts.AsNoTracking()
                   where subAlerts.AlertID &gt;= Id.AlertID &amp;&amp; subAlerts.DataWystapienia &gt; Id.DataWystapienia
                   select new MyAlerts { AlertID = subAlerts.AlertID, DataWystapienia = subAlerts.DataWystapienia, Message = subAlerts.Message };

var myAlertsList = alertList.OrderByDescending(a =&gt; a.AlertID).Take(Id.NumberOfRows)
                   .Concat(subAlertList.OrderByDescending(a =&gt; a.AlertID).Take(Id.NumberOfRows))
                   .OrderByDescending(a =&gt; a.AlertID).Take(Id.NumberOfRows);


this is fully equivalent to your code I only extracted the 2 lists

the last operation of code has 3 OrderByDescending(a =&gt; a.AlertID).take(Id.NumberOfRows) while only 1 is needed 

var myAlertsList = alertList.Concat(subAlertList).OrderByDescending(a =&gt; a.AlertID).Take(Id.NumberOfRows);