public JsonResult GetPhotosByAlbumId([FromQuery(Name = "Id")] int Id) { var photosResult = new List <Photo>(); try { //Get all photos from the services by album photosResult = PhotoServices.GetPhotosByAlbumId(Id); return(Json(new { message = MessagesHelper.TextMsg, type = MessagesHelper.success, photosResult })); } catch (Exception ex) { return(Json(new { message = MessagesHelper.TextMsg, type = MessagesHelper.warning, photosResult })); } }