Exemple #1
0
        public async Task <Result <Exception, Student> > AddAsync(Student student)
        {
            var newStudent = _context.Students.Add(student);

            await _context.SaveChangesAsync();

            return(newStudent.Entity);
        }
Exemple #2
0
        public async Task <Result <Exception, User> > AddAsync(User user)
        {
            var newUser = _context.Users.Add(user);

            await _context.SaveChangesAsync();

            return(newUser.Entity);
        }