//POST: api/unitdetails/ public HttpResponseMessage Post([FromBody] UnitRenoKeys unitKeys) { var repo = new UnitRenovationRepository(new ConstructionEntities()); var unitReno = new UnitRenoKeysTranslator().Translate(unitKeys); repo.Delete(ur => ur.hUnit == unitReno.hUnit && ur.hUnitRenoGrp == unitReno.hUnitRenoGrp); return Request.CreateResponse(HttpStatusCode.OK, unitReno); }
public void Context() { _entities = new ConstructionEntities(); _target = new UnitRenovationRepository(_entities); _deleteTarget = _entities.UnitRenoes.Where(r => r.OrigCompletionDate == null).ToList()[0]; Func<Contexts.UnitReno, bool> expression = (r => r.hUnitRenoGrp == _deleteTarget.hUnitRenoGrp && r.hUnit == _deleteTarget.hUnit); _target.Delete(expression); _results = _entities.UnitRenoes.Where(expression); }