public MyGalleries GetMyGalleries(int imageId, string userId) { var myout = new MyGalleries(); var res = new MyGalleries(ijpContext, userId); foreach (var gall in res.ItemGalleries) { var myItem = gall.GalleryFile.FirstOrDefault(x => x.FileId == imageId); if (myItem != null) { myout.ItemGalleries.Add(res.ItemGalleries.FirstOrDefault(x => x.Gallery.GalleryId == myItem.GalleryId)); } } return(myout); }
public MyContainer(IjpContext _ijpContext, string userId) { ijpContext = _ijpContext; myGalleries = new MyGalleries(ijpContext, userId); myImages = new MyImages(ijpContext, userId); }