public async Task <bool> UpdateAsync(CelebrityCard Card) { return(await Task.Factory.StartNew(() => { return this.Update(Card); })); }
public bool Create(CelebrityCard Card) { var cards = this.Get(); var originalSize = cards.Count; cards.Add(Card); var changes = this.Save(cards); return(changes != originalSize); }
public async Task <HttpResponseMessage> Update([FromBody] CelebrityCard card) { try { return(Request.CreateResponse(HttpStatusCode.OK, await new CelebritiesBLL().UpdateAsync(card))); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public async Task <HttpResponseMessage> Create([FromBody] CelebrityCard card) { try { var response = Request.CreateResponse(HttpStatusCode.OK, await new CelebritiesBLL().CreateAsync(card)); response.Headers.Add("Created_Id", card.Id); return(response); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public bool Update(CelebrityCard Card) { var cards = this.Get(); var index = cards.FindIndex(x => x.Id == Card.Id); if (index == -1) { return(false); } cards[index] = Card; var changes = this.Save(cards); return(true); }
public bool Update(CelebrityCard Card) { return(this.DAL.Update(Card)); }
public bool Create(CelebrityCard Card) { return(this.DAL.Create(Card)); }