public async Task <int> AddUserNutritionListsAsync(string userId, int nutritionListId) { UserNutritionLists userList = new UserNutritionLists(); userList.UserSecret = userId; userList.FKNutritionListId = nutritionListId; int succes = 0; try { await _sportDatabaseContext.UserNutritionLists.AddAsync(userList); succes = await _sportDatabaseContext.SaveChangesAsync(); return(succes); } catch (Exception e) { Console.WriteLine(e.Message); } return(succes); }
public async Task <int> Save() { int success = await _context.SaveChangesAsync(); return(success); }