Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
- at System.Guid.TryParseGuidWithNoStyle
- at System.Guid.TryParseGuid
- at System.Guid..ctor
- at System.DirectoryServices.AccountManagement.ADStoreCtx.IdentityClaimToFilter
- public object WebRequest<T>(string controller, Dictionary<string, string> parameters, Method apiMethod, string action)
- {
- RestClient client = new RestClient(Url + controller + "/");
- client.Authenticator = new NtlmAuthenticator();
- RestRequest request = new RestRequest(action, apiMethod);
- if (parameters != null && parameters.Count > 0)
- {
- foreach (var parameter in parameters)
- {
- request.AddParameter(parameter.Key, parameter.Value);
- }
- }
- object result = JsonToObject<T>(client.Execute(request).Content);
- return result;
- }
- @helper Username()
- {
- PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
- var username = System.Web.HttpContext.Current.User.Identity.Name.Replace(@"GIRLINGS", "");
- @username
- }
- @helper UserFullName()
- {
- using (var context = new PrincipalContext(ContextType.Domain))
- {
- var principal = UserPrincipal.FindByIdentity(context, User.Identity.Name);
- if (principal != null)
- {
- var fullName = string.Format("{0}", principal.DisplayName);
- @fullName
- }
- }
- }
Add Comment
Please, Sign In to add comment