Пример #1
0
        public bool RegistrUser(string userName, string password)
        {
            var userRepo = _userRepo
                                .Query()
                                .FirstOrDefault(x => x.UserName == userName);

            if (userRepo != null)
                return false;

            var user = new User
            {
                UserName = userName,
                AvatarUrl = "../Content/Images/defaultAva.jpg"
            };

            _userRepo.Create(user);
            _userRepo.Save();

            var authUser = new AuthUser
            {
                Password = password,
                UserId = user.Id

            };

            _aythUserRepo.Create(authUser);
            _aythUserRepo.Save();

            return true;
        }
Пример #2
0
 public PostGetVm(User user, DateTime date)
 {
     User = user;
     Date = date;
 }
Пример #3
0
 public CommentGetVm(User user, DateTime date)
 {
     User = user;
     Date = date;
 }