Esempio n. 1
0
        public Course Create(Course course)
        {
            Course co = _ctx.Courses.Add(course).Entity;

            _ctx.SaveChanges();
            return(co);
        }
        public Comment Create(Comment comment)
        {
            Comment c = _ctx.Comments.Add(comment).Entity;

            _ctx.SaveChanges();
            return(c);
        }
Esempio n. 3
0
        public User Create(User user)
        {
            User u = _ctx.Users.Add(user).Entity;

            _ctx.SaveChanges();
            return(u);
        }
Esempio n. 4
0
        public Topic Create(Topic topic)
        {
            Topic t = _ctx.Topics.Add(topic).Entity;

            _ctx.SaveChanges();
            return(t);
        }
Esempio n. 5
0
        public User Create(User user)
        {
            byte[] passHash;
            byte[] passSalt;
            _authenticationHelper.CreatePasswordHash(user.Password, out passHash, out passSalt);
            user.PasswordHash = passHash;
            user.PasswordSalt = passSalt;
            user.Password     = null;
            User u = _ctx.Users.Add(user).Entity;

            _ctx.SaveChanges();
            return(u);
        }