summaryrefslogtreecommitdiffstats
path: root/samples/OAuthServiceProvider/DataApi.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-04-19 07:09:32 -0400
committerAndrew Arnott <andrewarnott@gmail.com>2010-04-19 07:09:32 -0400
commit668c50fd19dc633bd367ac8ace37df8b5f9a5881 (patch)
tree8ab71b553fa22e12aae6817b3c6fab93acdd31df /samples/OAuthServiceProvider/DataApi.cs
parentfef932af78eac2b775452c4a851e84a813027548 (diff)
downloadDotNetOpenAuth-668c50fd19dc633bd367ac8ace37df8b5f9a5881.zip
DotNetOpenAuth-668c50fd19dc633bd367ac8ace37df8b5f9a5881.tar.gz
DotNetOpenAuth-668c50fd19dc633bd367ac8ace37df8b5f9a5881.tar.bz2
Updated OAuth C and SP samples to use standard WAP namespaces.
Diffstat (limited to 'samples/OAuthServiceProvider/DataApi.cs')
-rw-r--r--samples/OAuthServiceProvider/DataApi.cs55
1 files changed, 29 insertions, 26 deletions
diff --git a/samples/OAuthServiceProvider/DataApi.cs b/samples/OAuthServiceProvider/DataApi.cs
index d5adb10..9d531e6 100644
--- a/samples/OAuthServiceProvider/DataApi.cs
+++ b/samples/OAuthServiceProvider/DataApi.cs
@@ -1,31 +1,34 @@
-using System.Linq;
-using System.ServiceModel;
+namespace OAuthServiceProvider {
+ using System.Linq;
+ using System.ServiceModel;
+ using OAuthServiceProvider.Code;
-/// <summary>
-/// The WCF service API.
-/// </summary>
-/// <remarks>
-/// Note how there is no code here that is bound to OAuth or any other
-/// credential/authorization scheme. That's all part of the channel/binding elsewhere.
-/// And the reference to OperationContext.Current.ServiceSecurityContext.PrimaryIdentity
-/// is the user being impersonated by the WCF client.
-/// In the OAuth case, it is the user who authorized the OAuth access token that was used
-/// to gain access to the service.
-/// </remarks>
-public class DataApi : IDataApi {
- private User User {
- get { return OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.GetUser(); }
- }
+ /// <summary>
+ /// The WCF service API.
+ /// </summary>
+ /// <remarks>
+ /// Note how there is no code here that is bound to OAuth or any other
+ /// credential/authorization scheme. That's all part of the channel/binding elsewhere.
+ /// And the reference to OperationContext.Current.ServiceSecurityContext.PrimaryIdentity
+ /// is the user being impersonated by the WCF client.
+ /// In the OAuth case, it is the user who authorized the OAuth access token that was used
+ /// to gain access to the service.
+ /// </remarks>
+ public class DataApi : IDataApi {
+ private User User {
+ get { return OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.GetUser(); }
+ }
- public int? GetAge() {
- return User.Age;
- }
+ public int? GetAge() {
+ return User.Age;
+ }
- public string GetName() {
- return User.FullName;
- }
+ public string GetName() {
+ return User.FullName;
+ }
- public string[] GetFavoriteSites() {
- return User.FavoriteSites.Select(site => site.SiteUrl).ToArray();
+ public string[] GetFavoriteSites() {
+ return User.FavoriteSites.Select(site => site.SiteUrl).ToArray();
+ }
}
-}
+} \ No newline at end of file