Example #1
0
        public IUserAuth CreateUserAuth(IUserAuth newUser, string password)
        {
            var user = new Model.User()
            {
                Firstname = newUser.FirstName,
                Lastname  = newUser.LastName,
                Email     = newUser.Email,
                Password  = newUser.PasswordHash
            };

            _context.Users.Add(user);
            _context.SaveChanges();
            return(newUser);
        }
Example #2
0
        public object Any(Services.SetFullName request)
        {
            SiteInfoModel siteInformation = dbContext.SiteInfo.SingleOrDefault();

            if (siteInformation == null)
            {
                siteInformation         = new SiteInfoModel();
                siteInformation.Version = 1;
                siteInformation.Name    = request.FullName;
                dbContext.SiteInfo.Add(siteInformation);
            }

            siteInformation.Name    = request.FullName;
            siteInformation.Version = siteInformation.Version + 1;
            dbContext.SaveChanges();
            return(true);
        }