15,881,778 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by agolddog (Top 2 by date)
agolddog
26-Feb-20 10:18am
View
Wow, thanks for the quick responses. But, as I said, not really a programming question; sure, we could use Tuples, or a dedicated object as F_ES Sitecore mentions.
The latter is the refactoring I tend toward, as it gives better context for the pieces of data than a Tuple solution.
The real question is, how much should the use of out variables bother me. It really grinds my gears, but I'm not sure if I'm overblowing the situation.
agolddog
28-Oct-19 10:36am
View
I think I have to go with ZurdoDev and the the others. Your interaction will only produce one of two things: success or an exception.
If there's no exception, you have all the values you came with. Use one of the things you've already discovered to retrieve the new id, and create some object to return (instead of void), building that object from the input + the new id.
If there's an exception, you want to handle that in whatever way is appropriate for this layer of your system (I'd guess just let it bubble up, unless you have logging at this level).
One minor thing is your method name is misspelled: addSession.