Creating custom objects with custom properties using generics
I will focus on..


  Creating custom objects with custom properties using generics  


Which you do in this method..


public static KeyValuePair&lt;TCity, IEnumerable&lt;TBuilding&gt;&gt; GetData&lt;TCity, TBuilding&gt;()
    where TCity : City, new()
    where TBuilding : Building, new()
{
    TCity city = new TCity();
    IEnumerable&lt;TBuilding&gt; buildings = new List&lt;TBuilding&gt;();
    return new KeyValuePair&lt;TCity, IEnumerable&lt;TBuilding&gt;&gt;(city, buildings);
}




A KeyValuePair is archaic, you can use a ValueTuple nowadays
TBuilding does not require the new() constraint in this method
The choice for IEnumerable over IList is questionable, since you retrieve the items later on and have no way of adding them to an IEnumerable. So why create the IEnumerable in this method?
The name should reflect what you are doing. CreateCity seems more appropriate.


I would refactor this method..

public static (TCity city, IList&lt;TBuilding&gt; buildings) CreateCity&lt;TCity, TBuilding&gt;()
    where TCity : City, new()
    where TBuilding : Building
{
    var city = new TCity();
    var buildings = new List&lt;TBuilding&gt;();
    return (city, buildings);
}


EDIT:

Thinking about the refactored method. This doesn't even need to be a method anymore. It doesn't do anything but create objects for the types you specify.

What I would really do is throw out this ancient way of ORM, and use an existing API (EF, NHibernate, Dapper).