Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c# question #2

Open
medmelek opened this issue Nov 16, 2019 · 1 comment
Open

c# question #2

medmelek opened this issue Nov 16, 2019 · 1 comment

Comments

@medmelek
Copy link

medmelek commented Nov 16, 2019

ps: am new in c#
in userServices.cs file :
1/ how can user object use methode (withoutPassword) that she's not decalred in his class
2/ if a static methode with xModel type, can be used as a methode for all xModel instance object ?

@zfxsss
Copy link

zfxsss commented Aug 23, 2020

1/ how can user object use methode (withoutPassword) that she's not decalred in his class
It's an extension method defined on Class "User", note "this User" in the method signature
2/ if a static methode with xModel type, can be used as a methode for all xModel instance object ?
Yes, I think so, depending on accessibility, static methods also can be invoked from outside...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants