This is a tiny small tip for writing query expressions and using the EntityLogicalName value.
When you write a queryExpression you have to specify the name of the entity you want to query.
The name is a text string you can create a string and put the name of the entity
QueryExpression query = new QueryExpression("account");
a better way which makes the code easier to read and will ensure you don’t mistype the query is to use the EntityLogicalName attribute of a CRM entity. Below is an example of doing a query expression for the account
QueryExpression query = new QueryExpression(Account.EntityLogicalName);