Ejemplo n.º 1
0
        public PotentialConnection ProposeConnection(User from, User to, string introduction)
        {
            var potentialConnection = new PotentialConnection
            {
                From         = from,
                To           = to,
                Introduction = introduction,
                Created      = DateTime.UtcNow
            };

            _arachneContext.PotentialConnections.Add(potentialConnection);
            _arachneContext.SaveChanges();
            return(potentialConnection);
        }
Ejemplo n.º 2
0
        public User GetOrCreateUserByEmail(OktaResponseValues user)
        {
            User foundUser = _arachneContext.Users.FirstOrDefault(u => u.Email == user.Email);

            if (foundUser == null)
            {
                foundUser = new User
                {
                    Email     = user.Email,
                    FirstName = user.FirstName,
                    LastName  = user.LastName,
                    Created   = DateTime.UtcNow,
                };

                _arachneContext.Users.Add(foundUser);
                _arachneContext.SaveChanges();
            }

            return(foundUser);
        }