public IHttpActionResult Get() { PartyItemService partyItemService = CreatePartyItemService(); var partyItems = partyItemService.GetPartyItems(); return(Ok(partyItems)); }
private PartyItemService CreatePartyItemService() { var userId = Guid.Parse(User.Identity.GetUserId()); var partyItemService = new PartyItemService(userId); return(partyItemService); }
public ActionResult Edit(PartyItemEdit partyItem) { if (ModelState.IsValid) { _userId = Guid.Parse(User.Identity.GetUserId()); _partyItemService = new PartyItemService(_userId); _partyItemService.EditPartyItem(partyItem); return(RedirectToAction("Index")); } return(View(partyItem)); }