public IHttpActionResult PutExpectedDuration(int id, ExpectedDuration expectedDuration) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != expectedDuration.ID) { return(BadRequest()); } db.Entry(expectedDuration).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ExpectedDurationExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetExpectedDuration(int id) { ExpectedDuration expectedDuration = db.ExpectedDuration.Find(id); if (expectedDuration == null) { return(NotFound()); } return(Ok(expectedDuration)); }
public IHttpActionResult PostExpectedDuration(ExpectedDuration expectedDuration) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ExpectedDuration.Add(expectedDuration); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = expectedDuration.ID }, expectedDuration)); }
public override void UpdateDuration() { _expectedDuration = new Duration(0); _limitDuration = new Duration(0); ExecutionTime = new Duration(0);; foreach (var step in SubSteps) { step.UpdateDuration(); ExpectedDuration.Increment(step.ExpectedDuration); LimitDuration.Increment(step.LimitDuration); } }
public IHttpActionResult DeleteExpectedDuration(int id) { ExpectedDuration expectedDuration = db.ExpectedDuration.Find(id); if (expectedDuration == null) { return(NotFound()); } db.ExpectedDuration.Remove(expectedDuration); db.SaveChanges(); return(Ok(expectedDuration)); }
public override int GetHashCode() { int hashCode = 1946622093; if (Id != null) { hashCode += Id.GetHashCode(); } if (LocationId != null) { hashCode += LocationId.GetHashCode(); } if (BreakName != null) { hashCode += BreakName.GetHashCode(); } if (ExpectedDuration != null) { hashCode += ExpectedDuration.GetHashCode(); } hashCode += IsPaid.GetHashCode(); if (Version != null) { hashCode += Version.GetHashCode(); } if (CreatedAt != null) { hashCode += CreatedAt.GetHashCode(); } if (UpdatedAt != null) { hashCode += UpdatedAt.GetHashCode(); } return(hashCode); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is Break other && ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && ((StartAt == null && other.StartAt == null) || (StartAt?.Equals(other.StartAt) == true)) && ((EndAt == null && other.EndAt == null) || (EndAt?.Equals(other.EndAt) == true)) && ((BreakTypeId == null && other.BreakTypeId == null) || (BreakTypeId?.Equals(other.BreakTypeId) == true)) && ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) && ((ExpectedDuration == null && other.ExpectedDuration == null) || (ExpectedDuration?.Equals(other.ExpectedDuration) == true)) && IsPaid.Equals(other.IsPaid)); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is BreakType other && ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) && ((BreakName == null && other.BreakName == null) || (BreakName?.Equals(other.BreakName) == true)) && ((ExpectedDuration == null && other.ExpectedDuration == null) || (ExpectedDuration?.Equals(other.ExpectedDuration) == true)) && IsPaid.Equals(other.IsPaid) && ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) && ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) && ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true))); }
public override int GetHashCode() { int hashCode = 168552180; if (Id != null) { hashCode += Id.GetHashCode(); } if (StartAt != null) { hashCode += StartAt.GetHashCode(); } if (EndAt != null) { hashCode += EndAt.GetHashCode(); } if (BreakTypeId != null) { hashCode += BreakTypeId.GetHashCode(); } if (Name != null) { hashCode += Name.GetHashCode(); } if (ExpectedDuration != null) { hashCode += ExpectedDuration.GetHashCode(); } hashCode += IsPaid.GetHashCode(); return(hashCode); }