Jul 12, 2024modelbuilder entity in asp.net core mvc asked 1 year, 7 months ago modified 1 year, 7 months ago viewed 532 times Nov 16, 2014in ef core we have to impelement ientitytypeconfiguration instead of entitytypeconfiguration in this case we have full access to dbcontext modelbuilder and we. Modelbuilder.entity() .hasone(s => s.message) .withmany() .hasforeignkey(e => e.message_id) ef will configure your relationship as optional (or n :
Sep 5, 2018what i want to do is to create another partial dbcontext class and mark protected override void onmodelcreating(modelbuilder modelbuilder) method as partial but get errors: Sep 30, 2016modelbuilder.entity() .hasmany(b => b.posts) .withone(p => p.blog);