Example #1
0
        public TransactionStatus CreateStudent(StudentBo studentBo)
        {
            var transactionStatus = new TransactionStatus();
            var student           = BuiltStudentDomain(studentBo);

            student.StudentID = Guid.NewGuid();
            CemexDb.Student.Add(student);
            CemexDb.SaveChanges();

            return(transactionStatus);
        }
 public async Task UpdateAsync(StudentBo entityToUpdate)
 {
     try
     {
         uow.StudentRepository.Update(Mapper.Map <Student>(entityToUpdate));
         await uow.SaveAsync();
     }
     catch
     {
         throw;
     }
 }
        public async Task <int> InsertAsync(StudentBo entity)
        {
            try
            {
                var obj = Mapper.Map <Student>(entity);
                uof.StudentRepository.Insert(obj);
                await uof.SaveAsync();

                return(obj.Id);
            }
            catch
            {
                throw;
            }
        }
        public async Task <int> InsertAsync(StudentBo entity)
        {
            try
            {
                var obj = Mapper.Map <Student>(entity);
                uow.StudentRepository.Insert(obj);
                await sortableService.InsertTrigger(uow.Context.Students.Max(p => p.Id) + 1);

                await uow.SaveAsync();

                return(obj.Id);
            }
            catch
            {
                throw;
            }
        }
Example #5
0
 private Student BuiltStudentDomain(StudentBo studentBo)
 {
     return((Student) new Student().InjectFrom(studentBo));
 }