예제 #1
0
 public void Remove(int userId)
 {
     if (_useFirstOrm)
     {
         _firstOrm.Remove(userId);
     }
     else
     {
         _secondOrm.Remove(userId);
     }
 }
예제 #2
0
        public void Remove(int userId)
        {
            if (_useFirstOrm)
            {
                var user     = _firstOrm1.Read(userId);
                var userInfo = _firstOrm2.Read(user.InfoId);

                _firstOrm2.Delete(userInfo);
                _firstOrm1.Delete(user);
            }
            else
            {
                // add realization by yourself
                var user     = _secondOrm.Context.Users.First(i => i.Id == userId);
                var userInfo = _secondOrm.Context.UserInfos.First(i => i.Id == user.InfoId);

                _secondOrm.Context.Users.Remove(user);
                _secondOrm.Context.UserInfos.Remove(userInfo);
            }

            // you should remove DbUserEntity and DbUserInfoEntity via _ormAdapter
            _ormAdapter.Remove(userId);
        }
예제 #3
0
 public void Remove(int userId)
 {
     _ormAdapter.Remove(userId);
 }
예제 #4
0
        public void Remove(int userId)
        {
            IOrmAdapter adapter = ChooseAdapter(_useFirstOrm);

            adapter.Remove(userId);
        }