public static List <Models.FooterUrl> RemoveReferences(this List <Models.FooterUrl> list) { var newList = new List <Models.FooterUrl>(); list.ForEach(item => { var obj = new Models.FooterUrl(); obj = item.RemoveReferences(); newList.Add(obj); }); return(newList); }
public static Models.FooterUrl RemoveReferences(this Models.FooterUrl item) { var obj = new Models.FooterUrl(); obj = item.RemoveReference(); if (item.FooterHeader != null) { obj.FooterHeader = new FooterHeader(); obj.FooterHeader = item.FooterHeader.RemoveReference(); } return(obj); }
private static Models.FooterUrl RemoveReference(this Models.FooterUrl item) { var obj = new Models.FooterUrl(); if (item != null) { obj.Id = item.Id; obj.FooterHeaderId = item.FooterHeaderId; obj.IsActive = item.IsActive; obj.Name = item.Name; obj.Url = item.Url; } return(obj); }
public Models.FooterUrl saveFooter([FromBody] FooterUrl footerUrl) { Models.FooterUrl footer = new Models.FooterUrl(); if (footerUrl != null) { footer.Name = footerUrl.Name; footer.Url = footerUrl.Url; footer.FooterHeaderId = footerUrl.FooterHeaderId; footer.IsActive = true; } try { db.FooterUrls.Add(footer); db.SaveChanges(); } catch (Exception ex) { Console.Write(ex); } return(footer); }