Example #1
0
        public AzureUserAccess(AzureUser user, string ip, string userAgent, string reason, DateTimeOffset when)
        {
            var rowKey = String.IsNullOrEmpty(user.RowKey) ? String.Empty : user.RowKey + "|";

            rowKey += when.ToString("yyyy-MM-ddTHH-mm-ss");

            this.PartitionKey = user.PartitionKey;
            this.RowKey       = "access|" + rowKey;

            this.IP        = ip;
            this.UserAgent = userAgent;
            this.Reason    = reason;
            this.When      = when;
        }
Example #2
0
        private static AzureUserReference CreateUserNameReference(AzureUser user)
        {
            if (String.IsNullOrEmpty(user.NormalizedUserName))
            {
                return(null);
            }

            var referenceKey = AzureUserReferenceKey.ForUsername(user.NormalizedUserName);

            return(new AzureUserReference(referenceKey, user.Id)
            {
                ETag = "*"
            });
        }