SubQuery - The method or operation is not implemented.
See original GitHub issueI have such a query, which works OK if I don’t use string concatenation in the anonymous object Customer
, if I add l.FullName
+ “C” I get an exception saying “The method or operation is not implemented.”
var q = from se in _dataContext.ScheduleEvent
where se.Start.HasValue && se.Start.Value.Date == request.Date.Date
from seas in _dataContext.ScheduleEventAttendees
where seas.ScheduleEvent_Id == se.Id
from sea in _dataContext.ScheduleEventAttendee
where sea.Id == seas.ScheduleEventAttendee_Id
from sepNull in (from sep in _dataContext.ScheduleEventProperties
where sep.ScheduleEvent_id == se.Id && (sep.Name == Scheduler.PropEventJobId || sep.Name == Scheduler.PropEventLeadId)
select sep).DefaultIfEmpty()
from appTypeNull in (from appType in _dataContext.ScheduleEventAppointmentTypeHistory
where appType.ScheduleEvent_Id == se.Id
&& appType.Id == (from appTypeMax in _dataContext.ScheduleEventAppointmentTypeHistory
where appTypeMax.ScheduleEvent_Id == se.Id
select appTypeMax.Id).Max()
select appType).DefaultIfEmpty()
from jobTypeNull in (from sep in _dataContext.ScheduleEventProperties
where sep.ScheduleEvent_id == se.Id && (sep.Name == Scheduler.PropEventJobId || sep.Name == Scheduler.PropEventLeadId)
select new
{
JobId = sep.IntValue,
JobIdType = sep.Name == Scheduler.PropEventJobId ? JobQuoteJobIdType.JobQuote : JobQuoteJobIdType.Lead
}).DefaultIfEmpty()
from fabNull in (from sep in _dataContext.ScheduleEventProperties
where sep.ScheduleEvent_id == se.Id && (sep.Name == Scheduler.PropEventJobId || sep.Name == Scheduler.PropEventLeadId)
select new
{
Fabricator = sep.Name == Scheduler.PropEventJobId
? (from j in _dataContext.ClientJob
where j.Id == sep.IntValue
from quote in _dataContext.Quote
where quote.ClientJob_id == j.Id
from cb in _dataContext.CustomerBase
where cb.Id == (from quoteBid in _dataContext.QuoteBid
where quoteBid.Quote_id == quote.Id
select quoteBid.Fabricator_id).FirstOrDefault()
select new
{
Id = cb.Id,
Name = cb.Name,
Email = cb.ContactEmail,
Phone = cb.CanonicalPhone,
Address = cb.Address1,
Zip = cb.Postal
}).FirstOrDefault()
: (from l in _dataContext.Lead
where l.Id == sep.IntValue
from cb in _dataContext.CustomerBase
where cb.Id == l.Fabricator_Id
select new
{
Id = cb.Id,
Name = cb.Name,
Email = l.Email,
Phone = l.Phone,
Address = l.FullAddress,
Zip = l.Zip
}).FirstOrDefault()
}).DefaultIfEmpty()
from custNull in (from sep in _dataContext.ScheduleEventProperties
where sep.ScheduleEvent_id == se.Id && (sep.Name == Scheduler.PropEventJobId || sep.Name == Scheduler.PropEventLeadId)
select new
{
Customer = sep.Name == Scheduler.PropEventJobId
? (from j in _dataContext.ClientJob
where j.Id == sep.IntValue
from cb in _dataContext.CustomerBase
where cb.Id == j.Client_id
select new
{
Id = cb.Id,
Name = cb.Name,
Email = cb.ContactEmail,
Phone = cb.CanonicalPhone,
Address = cb.Address1,
Zip = cb.Postal
}).FirstOrDefault()
: (from l in _dataContext.Lead
where l.Id == sep.IntValue
select new
{
Id = l.Id,
Name = l.FullName + "C",
Email = l.Email,
Phone = l.Phone,
Address = l.FullAddress,
Zip = l.Zip
}).FirstOrDefault()
}).DefaultIfEmpty()
select new
{
Attendee = new
{
sea.Id,
sea.DisplayName,
sea.Email
},
Schedule = new
{
se.Id,
se.Start,
se.End,
se.Summary,
se.Fabricator_Id,
LastAppointmentType = appTypeNull == null ? (AppointmentType?) null : appTypeNull.AppointmentType
},
LastStatus = sepNull != null
? GetLastJobQuoteStatusLogEntry(sepNull.IntValue.Value, sepNull.Name == Scheduler.PropEventJobId ? JobQuoteJobIdType.JobQuote : JobQuoteJobIdType.Lead)
: null,
JobInfo = jobTypeNull,
Fabricator = fabNull,
Customer = custNull
};
Very un-expected error without any explanation.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Query returns "The method or operation is not implemented ...
From what I gather the Accept() method is involved in query optimisation. It looks like the functionality is incomplete. Unfortunately there ...
Read more >70722: ' The method or operation is not implemented. ...
inside a subquery that are to be "fused" with an outer query. Suggested fix: implement this method by simply calling the visitor's accept...
Read more >Subqueries (SQL Server)
Because they must return a single value, subqueries introduced by an unmodified comparison operator (one not followed by the keyword ANY or ALL...
Read more >Query not supported in DirectQuery mode - SQL with subquery
Solved: I am attempting to organize data from a SQL server by removing rows which contain duplicates in a certain column. When using...
Read more >Correlated subqueries - Amazon Redshift
Correlation references from within a subquery that contains a window function. select listid, qtysold from sales s where qtysold not in (select sum(numtickets) ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@integral-llc, attach your generated DataContext file. Maybe i can find time to look here more closer.
@ili, fix is obvious, but i don’t understand this code and why exception was throwed. Here is simplified test that reproduces error: