protected bool Equals(Building other) { return this.BuildingId == other.BuildingId && string.Equals(this.Name, other.Name) && string.Equals(this.Description, other.Description) && !(this.Workstations ?? new Workstation[0]).Except(other.Workstations ?? new Workstation[0]).Any(); ; }
public void WhenIUpdateAllTheInsertedBuildingEntities(bool useAsyncMethods) { foreach (var insertedEntity in _testContext.InsertedEntities.OfType<Building>()) { var updatedEntity = new Building() { BuildingId = insertedEntity.BuildingId, Name = "Updated " + insertedEntity.Name }; _testContext.UpdatedEntities.Add(updatedEntity); if (useAsyncMethods) { _testContext.DatabaseConnection.UpdateAsync(updatedEntity).GetAwaiter().GetResult(); } else { _testContext.DatabaseConnection.Update(updatedEntity); } } }
public void WhenIQueryForTheInsertedBuildingEntities(bool useAsyncMethods) { foreach (var insertedEntity in _testContext.InsertedEntities.OfType<Building>()) { var entityQuery = new Building() { BuildingId = insertedEntity.BuildingId }; _testContext.QueriedEntities.Add(useAsyncMethods ? _testContext.DatabaseConnection.GetAsync<Building>(entityQuery).Result : _testContext.DatabaseConnection.Get<Building>(entityQuery)); } }
protected bool Equals(Building other) { return this.BuildingId == other.BuildingId && string.Equals(this.Name, other.Name); }
public void WhenIUpdateAllTheInsertedBuildingEntities() { foreach (var insertedEntity in _testContext.InsertedEntities.OfType<Building>()) { var updatedEntity = new Building() { BuildingId = insertedEntity.BuildingId, Name = "Updated " + insertedEntity.Name }; _testContext.UpdatedEntities.Add(updatedEntity); _testContext.DatabaseConnection.Update(updatedEntity); } }