Base solution for your next web application
Open Closed

Get OU with level 1 sub ou #1385


User avatar
0
maikeloh created

I am working on a project where we use Organization Unit to manage Countrys and States, these are my Entities, i need some idea to be able to get a full list of Country with its States or a list or States each one of them with the correct parent Country. The main problem here is i dont have a direct relation between Country and State Entities. Thanks in advantage.

[Table("Country")] public class Country : FullAuditedEntity<long>, IMustHaveTenant, IMustHaveOrganizationUnit { public int TenantId { get; set; }

public virtual string Name { get; protected set; }    

}

[Table("State")] public class State : FullAuditedEntity<long>, IMustHaveTenant, IMustHaveOrganizationUnit { public int TenantId { get; set; }

public virtual string Name { get; protected set; }

}


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Why didn't you add Country navigation property to State entity?

  • User Avatar
    0
    maikeloh created

    Yeap I definitely used your aproach, but i ask before to comunity because i am giving first steps in asp, entity framework and abp, in other orm frameworks like doctrine for example you can listen for load collections of entities events and inject some proxy properties related to others entities not directly relationed and using the advantage of lazy loading. This feature has been very useful for me before and i am asking my self if this is possible with your development enviroment.

  • User Avatar
    0
    hikalkan created
    Support Team

    We are using Entity Framework. It's not possible since EF does not have such a feature (as I know).