Example #1
0
        public async Task <int> Delete(StudentRequest student)
        {
            var sv = new Student()
            {
                StudentId = student.StudentId
            };

            _context.Student.Remove(sv);
            return(await _context.SaveChangesAsync());
        }
Example #2
0
        public async Task <int> Create(StudentRequest student)
        {
            Student sv = new Student()
            {
                StudentName = student.StudentName,
                Address     = student.Address,
            };

            _context.Student.Add(sv);
            return(await _context.SaveChangesAsync());
        }