Ejemplo n.º 1
0
        public async Task AddOrChangeMenuBannerMapping(string menuId, string[] bannerIds)
        {
            DataTable dataTable = new DataTable("Menu_Banner_Mapping");

            dataTable.Columns.Add("MenuId", typeof(string));
            dataTable.Columns.Add("BannerId", typeof(string));
            foreach (var bannerId in bannerIds)
            {
                DataRow dr = dataTable.NewRow();
                dr["MenuId"]   = menuId;
                dr["BannerId"] = bannerId;
                dataTable.Rows.Add(dataTable);
            }
            await _menuRepository.AddOrChangeMenuBannerMapping(dataTable, menuId);
        }