Created
November 17, 2020 18:33
-
-
Save zHaytam/2df773102a43e2864ba2f1370a4bfe11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string GetCategoryId(object instance) | |
=> (instance as ListProductsRequest).CategoryId; | |
// Or as a lambda expression (which will help us more) | |
Func<object, string> getCategoryId = (instance) => (instance as ListProductsRequest).CategoryId; | |
// We can also generalize it | |
Func<object, object> getCategoryId = (instance) => (object)((instance as ListProductsRequest).CategoryId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment