I've an SQL Query like
WHERE Network <= @ipaddress AND LastIp >= @ipaddress
and i need to convert it to LINQ Query. Network and LastIp columns are string. I'm receiving @ipaddress from input at application.
string.Compare(ip.Network,ipAddress) == -1
&& string.Compare(ip.LastIp,ipAddress) == 1
is it okey to use string.Compare or is there another and much safer way to do that? So thankful for any help.
PS: Need to compare directly into LINQ Query with Repository Context. So i tried to use IpAddress function but it gave the LINQ Expression error.