Exemplo n.º 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);
        }
Exemplo n.º 2
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);
        }