-
-
Save Regenhardt/9d0a726df103fd59acdba9e268a8ddb5 to your computer and use it in GitHub Desktop.
For casting an object as part of a Fluent expression without having to put annoying parentheses around casting expressions.
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 static T As<T>(this object objectToCast) where T : class | |
{ | |
return objectToCast as T; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment