コード例 #1
0
        public async Task <LoginData> GetSuccessfulLoginsData(DateTime start, DateTime end)
        {
            var logins = await _activitiesRepository.Get(x =>
                                                         x.Created > start && x.Created < end && x.Action == PerformedAction.SuccessfulLogin);

            var externalLogins = await GetExternalLoginData(start, end);

            var loginsData = new LoginData()
            {
                ExternalLogins = externalLogins,
                AllLogins      = logins.Count + externalLogins
            };

            return(loginsData);
        }
コード例 #2
0
        public async Task <string> GetUserCreationDate(string username)
        {
            var activities = await _activitiesRepository.Get(x =>
                                                             x.Username == username);

            if (activities.Count.Equals(0))
            {
                return("-");
            }
            return(activities.OrderByDescending(x => x.Created).First().Created.ToString("u"));
        }