问题描述:

string last = url.Substring(url.LastIndexOf('/') + 1);

var provisionedSiteRequestRep = provisioningRequestRepository.SelectFirst(new WhereSpecification<ProvisioningRequest>(result => result.SiteUrl.Contains(last.ToString())));

Some time i am getting the null values of last.tosting() so i am getting exception for this code how to resolve this?

网友答案:

You are facing problem on this line

 (result => result.SiteUrl.Contains(last.ToString());

Can you please check that SiteUrl is type of string otherwise it not going to work for you. because last is type of string and Contains is method supported by string type ...

or

otherwise last need to be enumebrable collection and siteurl also enumerable collection than and only than Contains is supported

相关阅读:
Top