public void Delete(long id) { InvestmentPoco p = _db.Investments.Find(id); _db.Investments.Remove(p); _db.SaveChanges(); }
public bool Update(long id, InvestmentPoco investment) { try { _db.Entry(investment).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Update(long id, InvestmentPoco investment) { var isupdated = _repository.Update(id, investment); if (isupdated) { return(true); } else { return(false); } }
public HttpResponseMessage UpdateInvestment([FromBody] InvestmentPoco investment) { var isUpdated = _logic.Update(investment.Id, investment); if (isUpdated == true) { return(Request.CreateResponse(HttpStatusCode.OK, investment)); } else { return(Request.CreateResponse(HttpStatusCode.NotModified, investment)); } }
public void Create(InvestmentPoco investment) { _db.Investments.Add(investment); _db.SaveChanges(); }
public void Create(InvestmentPoco investment) { _repository.Create(investment); }
public HttpResponseMessage CreateInvestment([FromBody] InvestmentPoco investment) { _logic.Create(investment); return(Request.CreateResponse(HttpStatusCode.OK)); }