Are you able to expand a bit on typical inheritance for middle class or even nobles that are not king. At the sake of thread creep. I'm interested in more than the typical will and the first son/child got the farm and the 2nd went to the military and the 3rd went into the church. I do not know how other society cultures may be different.
Basically the younger sons often did get a small inheritance or a stipend but the ideal would be to marry another families daughter and her father has no sons. This establishes a cadet branch and your children inherit her lands. Some cadet branches would replace the main branch or exceed it. Some Dukes wre also more popweful than the King at least in terms of wealth and army (Duke of Orealns/Louis VII IIRC).
Middle class families often like marrying up, that was social mobility. Otherwise it probably was not to drastically different from boy meets girl and ideally the parents consent. It was easier to do in places like England say vs Russia or Naples. You could also get promoted to the noble class usually by being rich or bribing your way into it (and via service). Some places the middle class became the upper classes and were not nobles as such (Venice, Hanseatic League) but in effect were and they were treated as nobility for all intents and purposes. Some nobles married down for political purposes.
As now though social connections mattered, you could also use things like personal connections so if your family served the Duke, King/Queen etc and they liked you personally you could hope to get ennobled, get career opportunities/connections, have your daughters marry junior nobility etc.