I am not sure how to approach this it fixed item adding to the list of object. I have the slot of ads, that have to be prepulated so they could be selected based on front end parameter. So basically few of these ads can be picked on the website and be positioned. How could this list be simplified, because now it is block of repeated code.
private static List<AdItem> GetAdSlotItems()
{
var s = "";
return new List<AdItem>()
{
new AdItem { Type = AdType.LeftSky, Container = "div-ad-skyscraper-l", Sizes = new List<List<int>> { new List<int>() { 120, 600 }, new List<int>() { 160, 600 } }, Position = new List<Position>() { new Position() { Id = AdType.LeftSky.ToString(), Value = AdPosition.left.ToString() } } },
new AdItem { Type = AdType.RightSky, Container = "div-ad-skyscraper-r", Sizes = new List<List<int>> { new List<int>() { 120, 600 }, new List<int>() { 160, 600 } }, Position = new List<Position>() { new Position() { Id = AdType.RightSky.ToString(), Value = AdPosition.right.ToString() } } },
new AdItem { Type = AdType.LeaderBoard, Container = "div-ad-leaderboard", Sizes = new List<List<int>> { new List<int>() { 300, 250 } }, Position = new List<Position>() { new Position() { Id = AdPosition.inline.ToString(), Value = AdPosition.inline.ToString() } } },
new AdItem { Type = AdType.BillBoard, Container = "div-ad-billboard", Sizes = new List<List<int>> { new List<int>() { 728, 90 }, new List<int>() {970, 250 }, new List<int>() { 300, 50 } }, Position = new List<Position>() },
new AdItem { Type = AdType.MPU1, Container = "div-ad-rectangle-e1", Sizes = new List<List<int>> { new List<int>() {300, 250 }, new List<int>() { 300, 600 } }, Position = new List<Position>() { new Position() { Id = AdType.MPU1.ToString(), Value = AdPosition.mpu1.ToString() } } },
new AdItem { Type = AdType.MPU1, Container = "div-ad-rectangle-e2", Sizes = new List<List<int>> { new List<int>() {300, 250 }, new List<int>() { 300, 600 } }, Position = new List<Position>() { new Position() { Id = AdType.MPU2.ToString(), Value = AdPosition.mpu2.ToString() } } },
new AdItem { Type = AdType.MPU1, Container = "div-ad-rectangle-e3", Sizes = new List<List<int>> { new List<int>() {300, 250 }, new List<int>() { 300, 600 } }, Position = new List<Position>() { new Position() { Id = AdType.MPU3.ToString(), Value = AdPosition.mpu3.ToString() } } },
new AdItem { Type = AdType.WallPaper, Container = "div-ad-wallpaper", Sizes = new List<List<int>> { new List<int>() { 1, 1 } }, Position = new List<Position>() }
};
}
AdItem
. \$\endgroup\$