Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3,004 changed files
with
1,349,706 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
Samples/AdventureWorks/Generated/Nettiers.AdventureWorks.Contracts/ExtendedPrinciple.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
| ||
using System; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Security.Principal; | ||
|
||
namespace Nettiers.AdventureWorks.Contracts | ||
{ | ||
/// <summary> | ||
/// This class is used to extend the Thread.CurrentPrincipal object and add | ||
/// our own custom properties and methods. | ||
/// </summary> | ||
public class ExtendedPrincipal : IPrincipal | ||
{ | ||
#region Fields | ||
|
||
private IIdentity _identity; | ||
private IUser _user; | ||
private string _userName; | ||
|
||
#endregion Fields | ||
|
||
#region Constructors | ||
|
||
/// <summary> | ||
/// Extended Principal Constructor | ||
/// </summary> | ||
public ExtendedPrincipal(IIdentity identity) | ||
{ | ||
_identity = identity; | ||
_userName = identity.Name; | ||
} | ||
|
||
#endregion Constructors | ||
|
||
#region IPrincipal Members | ||
|
||
/// <summary> | ||
/// Identity | ||
/// </summary> | ||
/// <returns>IIdentity</returns> | ||
public IIdentity Identity | ||
{ | ||
get { return _identity; } | ||
} | ||
|
||
/// <summary> | ||
/// IsInRole | ||
/// </summary> | ||
/// <param name="RoleGuid">Role Guid</param> | ||
/// <returns>bool</returns> | ||
public bool IsInRole(Guid RoleGuid) | ||
{ | ||
return false; | ||
} | ||
|
||
/// <summary> | ||
/// IsInRole | ||
/// </summary> | ||
/// <param name="roleGuid">role Guid</param> | ||
/// <returns>bool</returns> | ||
public bool IsInRole(string roleGuid) | ||
{ | ||
return false; | ||
} | ||
|
||
/// <summary> | ||
/// CanPerformCommand | ||
/// </summary> | ||
/// <param name="CommandGuid">Command Guid</param> | ||
/// <returns>bool</returns> | ||
public bool CanPerformCommand(Guid CommandGuid) | ||
{ | ||
return CanPerformCommand(CommandGuid.ToString()); | ||
} | ||
|
||
/// <summary> | ||
/// CanPerformCommand | ||
/// </summary> | ||
/// <param name="CommandGuid">Command Guid</param> | ||
/// <returns>bool</returns> | ||
public bool CanPerformCommand(string CommandGuid) | ||
{ | ||
return false; | ||
} | ||
|
||
#endregion IPrincipal Members | ||
|
||
#region Public Properties | ||
|
||
/// <summary> | ||
/// Username | ||
/// </summary> | ||
public string UserName | ||
{ | ||
get { return _userName; } | ||
set { _userName = value; } | ||
} | ||
|
||
/// <summary> | ||
/// UserDetail | ||
/// </summary> | ||
public IUser UserDetail | ||
{ | ||
get { return _user; } | ||
set { _user = value; } | ||
} | ||
|
||
#endregion Public Properties | ||
|
||
#region Public Methods | ||
|
||
#endregion Public Methods | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Samples/AdventureWorks/Generated/Nettiers.AdventureWorks.Contracts/IUser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
| ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Nettiers.AdventureWorks.Contracts | ||
{ | ||
/// <summary> | ||
/// IUser interface. | ||
/// </summary> | ||
public interface IUser | ||
{ | ||
/// <summary> | ||
/// UserId | ||
/// </summary> | ||
int? UserID { get; set; } | ||
|
||
/// <summary> | ||
/// Username | ||
/// </summary> | ||
string UserName { get; set; } | ||
} | ||
} |
Oops, something went wrong.