Example #1
0
 public static Guid NewPsyauth(User user)
 {
     using (var dc = new PsyDc()) {
         var session = new Session() {
             DateCreated = DateTime.Now,
             SessionId = Guid.NewGuid(),
             UserId = user.UserId
         };
         dc.Sessions.InsertOnSubmit(session);
         dc.SubmitChanges();
         if (session.SerialNumber > 0) {
             return session.SessionId;
         }
     }
     return Guid.Empty;
 }
 partial void DeleteSession(Session instance);
 partial void UpdateSession(Session instance);
 partial void InsertSession(Session instance);
		private void detach_Sessions(Session entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_Sessions(Session entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}