© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
6 replies
Raki

❔ Optional parameter throwing error

I have a method

 
public UserAccount CreateOrUpdateUserAccountWithEmailSubscriptions
(string email, bool isNewsletterSubscribed, out bool isExists, bool signUp = false)
{

}
 
public UserAccount CreateOrUpdateUserAccountWithEmailSubscriptions
(string email, bool isNewsletterSubscribed, out bool isExists, bool signUp = false)
{

}


On calling this method like
                       _authenticationService.CreateOrUpdateUserAccountWithEmailSubscriptions(user.Email, viewModel.PatientInfoEmailEnabled, out var isExists);
                       _authenticationService.CreateOrUpdateUserAccountWithEmailSubscriptions(user.Email, viewModel.PatientInfoEmailEnabled, out var isExists);


It throws the error like screenshot error message. I don't want to send the optional parameter while passing since i believe it should take what i have specified in the method.
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Optional function parameter
C#CC# / help
3y ago
Slash Command optional parameter [Answered]
C#CC# / help
4y ago
Parameter Binder error: implement TryParse
C#CC# / help
10mo ago