[NF] implemented the two required methods using linq on ef