FetchXML, QueryExpression , .net linq , these three ways we can do it using SDK assemblies.