public static coreModels.MenuLinkList ToCoreModel(this webModels.MenuLinkList list) { var retVal = new coreModels.MenuLinkList(); retVal.InjectFrom(list); foreach (var link in list.MenuLinks) { retVal.MenuLinks.Add(link.ToCoreModel()); } return(retVal); }
public static coreModels.MenuLinkList ToCoreModel(this webModels.MenuLinkList list) { if (list == null) { throw new ArgumentNullException(nameof(list)); } var retVal = new coreModels.MenuLinkList(); retVal.InjectFrom(list); foreach (var link in list.MenuLinks) { retVal.MenuLinks.Add(link.ToCoreModel()); } return(retVal); }