There is probably a mismatch between the data in the database and your
class definition. My guess is that in your class you declared the Id
field to be of type string, but in the database it is an ObjectId.
Can you share the declaration of your AdminUser class and also the
contents of the document in the database using the mongo shell:
> db.users.find({"Username" : "xyz"})
Comparing the two should reveal the cause of your error message.
On Dec 13, 10:18 am, Joseph Good <
joe.d.g...@gmail.com> wrote:
> If it matters, the FindOneAs<AdminUser> also fails when applied to the
> non-typed collection.
>