profile
viewpoint

aochagavia/rocket_wasm 386

The Rocket game, now compiling to WASM

aochagavia/rocket 331

A toy game in Rust, using ggez

aochagavia/Polyglot-Mine-Sweeper 3

Multiple implementations of the mine sweeper game

aochagavia/domcode-wasm 2

Slides of the talk I gave at DomCode on 25 October 2018

aochagavia/CppMineSweeper 1

A console minesweeper game written in C++11

aochagavia/rs-hangman 1

An online version of the Hangman game in Rust

push eventaochagavia/efcore-issue-repro

Adolfo Ochagavía

commit sha 4ee770975bdad26760621a6ab9d31b09ac1f2318

Add raw tests

view details

Adolfo Ochagavía

commit sha 0a47866a6d12ad9ab676910d57cdad4740fac4fb

Simplify tests

view details

Adolfo Ochagavía

commit sha 87f0a41d0216d37c88f5ab77dcf02c107055d65a

Remove unused dependency

view details

push time in 16 days

push eventaochagavia/efcore-issue-repro

Adolfo Ochagavía

commit sha 38284ed42978145352decaed2420ae0bf5d6e723

Add raw tests

view details

Adolfo Ochagavía

commit sha 5e9ef1761e5a52aaf475dc96822087771edbf94e

Simplify tests

view details

Adolfo Ochagavía

commit sha e4e39984f6a489a9796426a63a56dea4a371a68e

Remove unused dependency

view details

push time in 16 days

push eventaochagavia/efcore-issue-repro

Adolfo Ochagavía

commit sha 810458e10628fae6aef9803e545ed14984a5d677

Remove the InMemory dependency, since we aren't using it any way

view details

push time in 16 days

push eventaochagavia/efcore-issue-repro

Adolfo Ochagavía

commit sha 7a864b25fb3000776e0512a6e61dc75d13b01593

Remove the InMemory dependency, since we aren't using it any way

view details

push time in 16 days

issue openeddotnet/efcore

EF Core 3.1 does not track owned entity in some cases

For the last day I have been trying to upgrade from EF Core 2.2.6 to version 3.1.1 without success. Some of my tests are failing and I have finally managed to come up with a minimum reproducible example. It seems like I have hit a bug, or at least an undocumented breaking change.

Note: I set up a repository with the code for this example and xUnit tests that make the problem clearer. The master branch uses EF Core 3.1.1 and has one failing test. The ef2 branch uses EF Core 2.2.6 and the same tests pass.

I have a parent entity (Registration) and an owned child entity (Contact):

public class Registration
{
    public Guid Id { get; set; }
    public Contact Contact { get; set; }

    public Registration()
    {
        Contact = new Contact();
    }
}

public class Contact
{
    public string LastName { get; set; }
}

The relation between them is specified as follows in the DbContext:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<Registration>()
        .OwnsOne(p => p.Contact);
}

The problem appears when following these steps:

  1. Call an endpoint to create a Registration with a Contact where all the fields are null
  2. Call an endpoint to set one of the Contact fields to some value, for the Registration we just created
  3. Call an endpoint to retrieve the Registration

I would expect the retrieved registration to contain the updated Contact field. However, it turns out the update was not saved by EF Core. I have done some debugging and I can see that EF Core is not tracking any object of type Contact.

I have observed that things do work when the second step creates a new Contact object from scratch and assigns that to the Registration, instead of trying to modify the existing Contact. Then EF Core does pick up the change and everything is saved correctly.

I have also observed that things do work when the first step creates a Registration with at least one non-null field in the Contact. Then EF Core picks up later changes, even without replacing the Contact field.

Is this a bug? It was not listed among the breaking changes introduced by EF Core 3.

Further technical details

EF Core version: 3.3.1 (I couldn't reproduce it in 2.2.6) Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET Core 3.0 Operating system: Windows 10

created time in 16 days

create barnchaochagavia/efcore-issue-repro

branch : ef2

created branch time in 16 days

create barnchaochagavia/efcore-issue-repro

branch : master

created branch time in 16 days

created repositoryaochagavia/efcore-issue-repro

created time in 16 days

create barnchaochagavia/AspCoreTestingExample

branch : master

created branch time in 3 months

created repositoryaochagavia/AspCoreTestingExample

created time in 3 months

push eventaochagavia/video-networking

Adolfo Ochagavía

commit sha fd3d7565b910bdb3c98c49457561bb50e7cc333f

Add readme

view details

push time in 3 months

create barnchaochagavia/video-networking

branch : master

created branch time in 3 months

created repositoryaochagavia/video-networking

Experiment around video-based networking

created time in 3 months

create barnchaochagavia/crdt-experiments

branch : master

created branch time in 3 months

created repositoryaochagavia/crdt-experiments

created time in 3 months

push eventaochagavia/notepad-hijacker

Adolfo Ochagavía

commit sha 2c581d369973d20e20b9a5a1f1245575586e43f9

Reverse the string currently open in notepad

view details

push time in 4 months

create barnchaochagavia/notepad-hijacker

branch : master

created branch time in 4 months

created repositoryaochagavia/notepad-hijacker

created time in 4 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 5f501ee6aa004b851568067b80036d00a0aab4fc

Challenge 23

view details

push time in 4 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 3c4852a616dea0ba5125930caeb42931c759f2fd

Challenge 22

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 897a4da250bd7a9f009d78c9646fee4ae587029d

Challenge 21

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 837f1fddce21a1dbb1029164beb694f1f9321345

Challenges 19 and 20

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 5863864ce60523781fcf24a7f1b8cfa52a91ad0d

Challenge 18

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha af56124bfec703ccde0ad33bc6665c1cf1c69caa

Attempt at challenge 17

view details

Adolfo Ochagavía

commit sha d835f9941317465d5573665ff97b325512e1fa2c

Decrypting last block works!

view details

Adolfo Ochagavía

commit sha f901913f704f7bfa1b4dd7672c3d4e4757c7a227

Finish challenge 17

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha fda778bf61029d63baf0d639d1dc1b5439366b31

Challenge 16

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha bb0b92053f54bf9a2f6a6b60e7524a057510038f

Challenge 15

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 1da0509c1ffebf8d99bb02a7378d2e83d8be0734

Challenge 14

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 01109d3964536c7272d2c317c57a07a94b876ea5

Challenge 13

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 020e5db148e6c9604a893a84cb24066da7b2828b

Cleanup and preparation for challenge 13

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha d6de0c887ffd6a65cdbadc8f8c392c55cf9b5422

Challenge 11

view details

Adolfo Ochagavía

commit sha ae86842ce51bc391de2308f5b24dec73fec55f29

Challenge 12

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 2b0442548171805a70816eaa0a50749e9a665805

Implement AES CBC in terms of AES ECB

view details

Adolfo Ochagavía

commit sha cc0c46feb9badc0e1be81f442c424cce82cb3943

Challenge 10

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha 090424e4a6f99bffde3ad44219a986c80a1ba155

Set 1, challenge 7 and 8

view details

push time in 5 months

push eventaochagavia/matasano

Adolfo Ochagavía

commit sha c9b38d7aa7106c3b9d726150da1e65eed833b434

Set 1, challenge 5

view details

Adolfo Ochagavía

commit sha 681ea867efe8d60b3f60c4b7705690f568af7285

Set 1, challenge 6

view details

push time in 5 months

create barnchaochagavia/matasano

branch : master

created branch time in 5 months

created repositoryaochagavia/matasano

My solutions to the matasano crypto challenge in Rust

created time in 5 months

more