public bool Equals(ExampleObjectC other) { if (ReferenceEquals(other, null)) { return(false); } return(other.Id == Id); }
public async Task SavingExampleObject_ThatOverridesEqualsAndGetHashCodeMethods_SavesSuccessfully() { SetupContextWithRequestPipelineForSaving( new DataServiceContext[] { DefaultTrackingContext }, ResponseC, "http://localhost:8000/ExampleObjectCs(1)"); var exampleObject = new ExampleObjectC { Id = 0, Name = "Example1" }; DefaultTrackingContext.AddObject("ExampleObjectCs", exampleObject); Assert.NotNull(DefaultTrackingContext.GetEntityDescriptor(exampleObject)); await SaveContextChangesAsync(new DataServiceContext[] { DefaultTrackingContext }); }