public async Task <int> setMainCV(Guid cvID) { var cv = await _dbContext.CVs.FirstOrDefaultAsync(c => c.ID == cvID); if (cv.Is_choosen == false) { var user = _acountProvider.getCurrentUser(); var cvChoosen = _dbContext.CVs.FirstOrDefault(c => c.User == user && c.Is_choosen == true); if (cvChoosen != null) { cvChoosen.Is_choosen = false; } cv.Is_choosen = true; await _dbContext.SaveChangesAsync(); return(1); } else { return(0); } }
public User getUserInfo() { return(_acountProvider.getCurrentUser()); }