Пример #1
0
        public IdeasBundle CreateIdeasBundle(Belt2Context _context)
        {
            IdeasBundle newIdeasBundle = new IdeasBundle
            {
                IdeaModel = new Idea(),
                AllIdeas  = _context.ideas.Include(i => i.UsersWhoLiked).ThenInclude(m => m.User).ToList()
            };

            return(newIdeasBundle);
        }
Пример #2
0
        public User CreateUser(Belt2Context _context)
        {
            User newUser = new User
            {
                Name     = this.Name,
                Alias    = this.Alias,
                Email    = this.Email,
                Password = this.Password
            };

            _context.users.Add(newUser);
            _context.SaveChanges();

            return(newUser);
        }