public void InsertTeacher(TeacherEntity teacher) { TeachersRepository teachRepo = new TeachersRepository(); using (var uow = UnitOfWork.CreateUoW()) { try { teachRepo.Create(EntitiesMapper.ToDbModel(teacher), uow); uow.ApplyChanges(); } catch (Exception ex) { uow.Rollback(); DbLog.LogError("Error inserting teacher " + teacher, ex); throw ex; } } }