When I learned the 'Find' method of 'EntityFramework', I encountered a problem, why the incoming parameter is an array, but the returned result is an entity. When I pass multiple primary keys, this method gives an error, I think this is not reasonable, the parameter should not be an array, why do you want to design this way?
The Find method accepts an array because of composite primary keys - multiple values are needed in order to identify a single entity. In other words, a single Find invocation always finds a single entity instance given a single primary key, the latter of which may contain 1 or more values. This is explained in the XML documentation.
oh , Thanks锛乊ou solved my doubt.
Most helpful comment
The Find method accepts an array because of composite primary keys - multiple values are needed in order to identify a single entity. In other words, a single Find invocation always finds a single entity instance given a single primary key, the latter of which may contain 1 or more values. This is explained in the XML documentation.