namespace IceImportDAL.Query.MenuResolution; // Resolves EntityId -> the Menu that owns that entity's SaveWebServiceId. Import only ever saves // (insert or, when the target's own natural key already exists, an update folded into the same // Save call) — it never issues a Get or a Delete against the target's Menu, so those WebServiceIds // are intentionally not selected here. // No existing FrameworkBLL/FrameworkDAL query exposes "Menu by EntityId" (MenuQB.GET_MENU takes // @menuid, MenuBLL has no EntityId-keyed lookup) — this is a narrow, additive, read-only query // against MMENU metadata (not business data), added here rather than editing FrameworkDAL/FrameworkBLL // to avoid touching the shared IMenuBLL contract other modules depend on. // MMENU has no TENANTID column (Menu metadata is shared across tenants using the same schema). public static class MenuResolutionQB { public const string GET_MENU_BY_ENTITYID = @" SELECT TOP 1 M.MENUID AS MenuId, M.ENTITYID AS EntityId, M.SAVEWEBSERVICEID AS SaveWebServiceId FROM MMENU M WHERE M.ENTITYID = @EntityId AND M.STATUS = 1 ORDER BY M.MENUID"; }