-
Notifications
You must be signed in to change notification settings - Fork 191
Support Set<T> & Get<T> in ISessionCollection #286
Conversation
Hi @hishamco, I'm your friendly neighborhood Microsoft Open Technologies, Inc. Pull Request Bot (You can call me MSOTBOT). Thanks for your contribution! The agreement was validated by Microsoft Open Technologies, Inc. and real humans are currently evaluating your PR. TTYL, MSOTBOT; |
Hi @hishamco, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! TTYL, DNFBOT; |
@hishamco, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
public static void Set<T>(this ISessionCollection session, string key, T value, ISessionFormatter<T> formatter) | ||
{ | ||
session.Set(key, formatter.Serialize(value)); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When committing from Windows to GitHub or git in general: always a line-break at the end of each file, so the diff does not show this:
Read more on No newline before the end of file - Stackoverflow.
Note: it will not actually add that extra line in source-control (but just squash out the last \r
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasonwilliams200OK I added two methods without adding or modifying line-break
Currently we're not comfortable making this part of the built in interface (even though they are extension methods). The current recommendation is to put something like this into your application code and use whatever serializer/deserialize best fits your needs. We might revisit this in the future. |
Thanks @davidfowl |
Provide a generic version of
ISessionCollection.Set<T>
andISessionCollection.Get<T>
which allow the developers to implementISessionFormatter
. Based on David Fowler suggestion we can plugBondSessionFormatter
orProtoBufSessionFormatter
as well./cc @Tratcher