コード例 #1
0
        public IActionResult BlockUser(int blockedId)
        {
            using (var context = new RevojiDataContext())
            {
                DBBlocking dBBlocking = new DBBlocking();
                dBBlocking.BlockedAppUserId = blockedId;//TODO: check if user actually exists
                dBBlocking.BlockerAppUserId = ApiUser.ID;

                context.Add(dBBlocking);
                context.Save();

                return(Ok(new AppUserBlocking(dBBlocking)));
            }
        }
コード例 #2
0
 public void UpdateDB(DBBlocking dBBlocking)
 {
     dBBlocking.BlockerAppUserId = BlockerId;
     dBBlocking.BlockedAppUserId = BlockedId;
 }
コード例 #3
0
 public AppUserBlocking(DBBlocking dBBlocking)
 {
     BlockerId = dBBlocking.BlockerAppUserId;
     BlockedId = dBBlocking.BlockedAppUserId;
 }