//public AddressPoco ReadAddress(long id) //{ // throw new NotImplementedException(); //} public CompanyPoco Add(CompanyPoco company) { if (company == null) { throw new ArgumentNullException("Company"); } _db.Companies.Add(company); _db.SaveChanges(); return company; }
public bool Update(long id, CompanyPoco company) { var isupdated = _repository.Update(id, company); if (isupdated) { return true; } else { return false; } }
public bool Update(long id, CompanyPoco company) { try { _db.Entry(company).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return true; } catch (Exception) { return false; } }
//public AddressPoco ReadAddress(long id) //{ // throw new System.NotImplementedException(); //} public CompanyPoco Add(CompanyPoco company) { return _repository.Add(company); }