none
SQL ==> LINQ What i can do RRS feed

  • Question

  • i have sql query i dont know when i use in linq to EF

    Please Hep me 

    Thank you so much

    DECLARE @CheckIn DATETIME, @CheckOut DATETIME
    SET @CheckIn ='2015-09-23 09:00' 
    SET @CheckOut = '2015-09-23 11:00';
    
    SELECT		ProjectorID
    FROM		Projector t1
    WHERE		t1.ProjectorID NOT IN
    (
    SELECT		t3.ProjectorID
    FROM (
    SELECT		t1.ProjectorID, t2.ReserveCheckin, t2.ReserveCheckOut
    FROM		Projector t1 INNER JOIN Reserve t2 ON t1.ProjectorID = t2.ProjectorID
    )			t3
    WHERE		(t3.ReserveCheckin BETWEEN @CheckIn AND @CheckOut)
    AND			(t3.ReserveCheckOut BETWEEN @CheckIn AND @CheckOut)
    )

    • Moved by CoolDadTx Tuesday, September 29, 2015 5:47 PM EF related
    Tuesday, September 29, 2015 10:09 AM

Answers

All replies