コード例 #1
0
        /**
         * Create a new account.
         */
        public User Register(string email, string password, string username)
        {
            var gravatar = new GravatarHelper();

            var user = new User
            {
                Email     = email,
                Username  = username,
                Password  = password,
                EmailMd5  = gravatar.CalculateMD5Hash(email),
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now,
            };

            _context.Users.Add(user);
            _context.SaveChanges();

            return(AppendToken(user));
        }