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))); } }
public void UpdateDB(DBBlocking dBBlocking) { dBBlocking.BlockerAppUserId = BlockerId; dBBlocking.BlockedAppUserId = BlockedId; }
public AppUserBlocking(DBBlocking dBBlocking) { BlockerId = dBBlocking.BlockerAppUserId; BlockedId = dBBlocking.BlockedAppUserId; }