converted query to LinQ operatioins