I have this linq query
List<Details> DetailList = new List<Details>();
DetailList = (from areadetails in context.AreaDetails.Where(x => (bool)x.IsActive && x.Area == area)
join jobdetails in context.JobDetails.Where(x => x.IsActive) on jobdetails.BuildDetailID equals areadetails.BuildDetailID
select new Details
{
Area = areadetails.AreaName,
JobLink = (jobdetails.EJ2JobLink != null) ? jobdetails.JobLink + "/console" : null,
JobId = (jobdetails.EJ2JobLink != null) ? jobdetails.JobLink.Split('/').Last() : null
}).ToList();
JobLink = job/it/development/41
I have to get the job id(41) from the link. When I have run this(JobLink.Split('/').Last()) separately in console application get correct job id from the link.When I used in linq.
I got an exception like this:
LINQ to Entities does not recognize the method 'System.String Format(System.String, System.Object[])' method, and this method cannot be translated into a store expression.
Anyone know why? Anyone know an alternative way of doing this to make it work?