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); }
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); }