This commit is contained in:
Paul Schneider 2019-05-07 14:01:23 +01:00
commit 02160f1eaf
26 changed files with 129 additions and 132 deletions

View file

@ -24,7 +24,7 @@ namespace Yavsc.Controllers
[HttpGet]
public IEnumerable<MusicalPreference> GetMusicalPreferences()
{
return _context.MusicalPreferences;
return _context.MusicalPreference;
}
// GET: api/MusicalPreferencesApi/5
@ -36,7 +36,7 @@ namespace Yavsc.Controllers
return HttpBadRequest(ModelState);
}
MusicalPreference musicalPreference = _context.MusicalPreferences.Single(m => m.OwnerProfileId == id);
MusicalPreference musicalPreference = _context.MusicalPreference.Single(m => m.OwnerProfileId == id);
if (musicalPreference == null)
{
@ -89,7 +89,7 @@ namespace Yavsc.Controllers
return HttpBadRequest(ModelState);
}
_context.MusicalPreferences.Add(musicalPreference);
_context.MusicalPreference.Add(musicalPreference);
try
{
_context.SaveChanges(User.GetUserId());
@ -118,13 +118,13 @@ namespace Yavsc.Controllers
return HttpBadRequest(ModelState);
}
MusicalPreference musicalPreference = _context.MusicalPreferences.Single(m => m.OwnerProfileId == id);
MusicalPreference musicalPreference = _context.MusicalPreference.Single(m => m.OwnerProfileId == id);
if (musicalPreference == null)
{
return HttpNotFound();
}
_context.MusicalPreferences.Remove(musicalPreference);
_context.MusicalPreference.Remove(musicalPreference);
_context.SaveChanges(User.GetUserId());
return Ok(musicalPreference);
@ -141,7 +141,7 @@ namespace Yavsc.Controllers
private bool MusicalPreferenceExists(string id)
{
return _context.MusicalPreferences.Count(e => e.OwnerProfileId == id) > 0;
return _context.MusicalPreference.Count(e => e.OwnerProfileId == id) > 0;
}
}
}