public MarketGroup Get(int id)
 {
     invMarketGroupRepo.FindChildrenInGroup(id);
     MarketGroup res = new MarketGroup();
     res.currentGroup = invMarketGroupRepo.Find(id);
     if (res.currentGroup != null)
     {
         res.childGroups = invMarketGroupRepo.FindChildrenInGroup(id);
         if(res.currentGroup.hasTypes != null && (bool) res.currentGroup.hasTypes ){
             res.types = invTypeRepo.FindChildrenOfMarketGroup(id);
         }
         return res;
     }
     return null;
 }
 public MarketGroup Get()
 {
     MarketGroup res = new MarketGroup();
     res.childGroups = invMarketGroupRepo.FindRoot();
     return res;
 }