public List <PhotoAlbum> GetByHouseId(string houseId) { var param = new[] { new SqlParameter("@houseId", houseId), }; var albums = Call(SP_PHOTO_ALBUM_GETBYHOUSEID, param, DataReader.ReadAlbum); foreach (var album in albums) { var imageAdapter = new ImageAdapter(); album.Items = imageAdapter.GetByAlbumId(album.Id); } return(albums); }
public PhotoAlbum GetById(string id) { var param = new[] { new SqlParameter("@id", id), }; var album = Call(SP_PHOTO_ALBUM_GETBYID, param, DataReader.ReadAlbum).FirstOrDefault(); if (album != null) { var imageAdapter = new ImageAdapter(); album.Items = imageAdapter.GetByAlbumId(album.Id); } return(album); }