Click here to Skip to main content
15,562,561 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have "Datatbase1.tt" file as i press "ctrl+s"(save) then i get this error

"Could not find an implementation of the query pattern for source type 'int'. 'Select' not found " on "bold font text" below

using (var context = new JobTrackDbContext())
{
retval = (from ai in context.JtContrAssignmentInfo(AssignmentId)
select new JobTrackAssignmentDetailsViewData
{
InsuredName = ai.InsuredName == null ? "" : ai.InsuredName,
InsuredEmail = ai.InsuredEmail == null ? "" : ai.InsuredEmail,
InsuredPhone = ai.Phone == null ? "" : ai.Phone,
LossAddress = ai.LossAddress == null ? "" : ai.LossAddress,
ClientName = ai.ClientName == null ? "" : ai.ClientName,
Claim = ai.Claim == null ? "" : ai.Claim
}).First();
}

What I have tried:

I have added following namespaces

using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Data.SqlTypes;
using System.Text;
using System.Threading.Tasks;
Posted
Updated 7-Oct-21 2:42am
v3

1 solution

Whatever type is returned by your JtContrAssignmentInfo method - which you haven't shown - it doesn't implement either IEnumerable<T> or IQueryable<T>.

You either need to return a type which implements one of those interfaces, or provide your own query pattern monad methods for the returned type.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900