public static void AddPhoto(PhotoModel photo) { byte[] image = new byte[photo.Image.ContentLength]; photo.Image.InputStream.Read(image, 0, photo.Image.ContentLength); Logic.photosLogic.AddPhoto(photo.AlbumId, photo.Title, photo.AccountLogin, image); }
public static IEnumerable <PhotoModel> GetPhotosByAlbum(int albumId) { var photos = Logic.photosLogic.GetPhotosByAlbum(albumId); return(PhotoModel.GetAll().Where(x => x.AlbumId == albumId).ToArray()); }