コード例 #1
0
        public void AsynchLogUserRegistration(Guid?userId, string ip)
        {
            var userRegistrationLog = new UserRegistrationLog
            {
                UserId    = userId.Value,
                IpAddress = ip,
                DateTime  = DateTime.Now
            };

            AsynchDelegate aDelegate = () =>
            {
                DataService.PerThread.UserRegistrationLogSet.AddObject(userRegistrationLog);
                DataService.PerThread.SaveChanges();
            };

            var asynchRes = aDelegate.BeginInvoke(null, null);

            aDelegate.EndInvoke(asynchRes);
        }
コード例 #2
0
        public void AsynchLogUserAuthentification(string userName, string ip, bool status)
        {
            var userAuthentificationLog = new UserAuthentificationLog
            {
                UserName  = userName,
                IpAddress = ip,
                Status    = status,
                DateTime  = DateTime.Now
            };

            AsynchDelegate aDelegate = () =>
            {
                DataService.PerThread.UserAuthentificationLogSet.AddObject(userAuthentificationLog);
                DataService.PerThread.SaveChanges();
            };

            var asynchRes = aDelegate.BeginInvoke(null, null);

            aDelegate.EndInvoke(asynchRes);
        }
コード例 #3
0
        public void AsynchLogUserPollVote(Guid?userId, Guid groupMemberId, Guid pollId, string result)
        {
            var userPollVoteLog = new UserPollVoteLog
            {
                UserId        = userId.Value,
                GroupMemberId = groupMemberId,
                PollId        = pollId,
                Result        = result,
                DateTime      = DateTime.Now
            };

            AsynchDelegate aDelegate = () =>
            {
                DataService.PerThread.UserPollVoteLogSet.AddObject(userPollVoteLog);
                DataService.PerThread.SaveChanges();
            };

            var asynchRes = aDelegate.BeginInvoke(null, null);

            aDelegate.EndInvoke(asynchRes);
        }