In this statement if Trans.param1== param1Value returns nothing, you will hit the error above.
Class1 objClass1 = _db.Class1.First(Trans => Trans.param1== param1Value);
To prevent this, you need to use 'FirstOrDefault' instead
Class1 objClass1 = _db.Class1.FirstOrDefault(Trans => Trans.param1== param1Value);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment