Content deleted Content added
→Code examples: Modified the code samples to correct errors and make them easier to read and understand |
|||
Line 56:
<syntaxhighlight lang=CSharp>
dataType
{ /
dataType data = (dataType)
if (
// If it doesn't exist in the cache, retrieve it from the database:
data =
// Put the returned data in the cache for future requests:
Cache.Add(userid, data);
}
return data;
}
Line 72 ⟶ 76:
<syntaxhighlight lang=CSharp>
void
{
// Update the user information in the database:
result = UpdateUserDataInDatabase(data);
if (result) {▼
{
// If successfully updated, update the cache:
Cache.Put(userid, data);
}
|