51

Steve Sanderson gave a very interesting presentations at Techdays 2012 in the Netherlands. In one of them he presented a library that he used for client-server communication in MVC application: Upshot.

I was really amazed how easy it was to use it, so I wanted to download and test it. I found the download link here through NuGet, but I cannot find any documentation. Does anyone have something that works? I would also appreciate the sample code that Steve showed as during presentation.

EDIT:

I found the online presentation I attended at Techdays. It's soooo much worth seeing. You will get a glance of what upshot is capable of and also get an idea how to start with it. Good luck and have fun.

The link: http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2159

tpeczek
  • 23,867
  • 3
  • 74
  • 77
Michal B.
  • 5,676
  • 6
  • 42
  • 70
  • 2
    Added the upshot tag for you. – Christofer Eliasson Feb 19 '12 at 09:41
  • yep, neither did I. I am unable to find any docs on this. I am assuming upshot.js is a new-born. – tugberk Feb 19 '12 at 13:47
  • 1
    You can also look here: http://denverdeveloper.wordpress.com/category/upshot/ – gius Jul 13 '12 at 15:44
  • Things are likely to change, but this link is the best one I have found so far : http://bartjolling.blogspot.com/2012/02/building-single-page-apps-with-aspnet.html – sacha barber Feb 21 '12 at 16:10
  • 1
    Notice for future visitors: upshot has been discontinued by microsoft. Some alternatives are suggested in the comments: http://www.riaservicesblog.net/Blog/post/WCF-RIA-Services-is-Dead-Long-Live-WCF-RIA-Services.aspx – Opflash Mar 29 '13 at 14:25

4 Answers4

16

I found one which is one of the MS samples for SPAs (which might be the only one for now):

ASP.NET Single Page Application (SPA) BigShelf

The complete tutorial on this project can be found here: BigShelf

Edit:

See this tweet from Steve Sanderson: https://twitter.com/#!/stevensanderson/status/171561402597773312

We're setting up a website for Upshot/SPA right now. Hopefully will go live this week! Sorry for delay.

tugberk
  • 57,477
  • 67
  • 243
  • 335
  • Steve just updated his blog with pointers to the samples http://blog.stevensanderson.com/2012/03/06/single-page-application-packages-and-samples/ – David Lay Mar 07 '12 at 03:11
8

Edit: see blog post of Steven over here with sample download code: http://blog.stevensanderson.com/2012/03/06/single-page-application-packages-and-samples/

Don't know either how to access the helper, would love to know so I can play with it :-)

This seems to do the trick for now:

<script src="../../Scripts/knockout-2.0.0.js" type="text/javascript"></script>
<script src="../../Scripts/upshot.js" type="text/javascript"></script>
<script src="../../Scripts/upshot.compat.knockout.js" type="text/javascript"></script>

<script type="text/javascript">

    upshot.metadata({ "CLASSNAME:#NAMESPACE":{ "key": ["aId"],
        "fields": {
            "aId": { "type": "Int32:#System" }, 
            "Title": { "type": "String:#System" },
            "Description": { "type": "String:#System" },
            "Effort": { "type": "Double:#System" }
            }
        }
    });

    var myDataSource = new upshot.RemoteDataSource({
        providerParameters: {
            url: "http://localhost:7018/api/CONTROLLERNAME",
            operationName: "",
            operationParameters: {}
        },
        entityType: "CLASSNAME:#NAMESPACE"
    });
            myDataSource.refresh(function (results) {
                alert(results[0].Title());
            });

</script>

You need to replace CLASSNAME:#NAMESPACE with your classname and namespace, so for example: "WorkItem:#MySystem.Models".

And replace the CONTROLLERNAME with the actual name of the controller, in the case of this

public class MyTasksController : ApiController 

you will need to replace CONTROLLERNAME with MyTasks

And fill the stuff inside the metadata according to your model objects. I hope the code samples come online soon, because this is a lot of work :-(

Erik Lieben
  • 1,249
  • 6
  • 12
  • I'm wondering how difficult it would be to write a ScriptSharp extension to take c# classes and convert them over to the metadata. – Richard B Aug 07 '12 at 13:17
1

Looking at the BigShelf example, their are a few extra available packages you can use.

I haven't tried them myself yet, but take a look at:

http://nuget.org/packages/Upshot

http://nuget.org/packages/SinglePageApplication

I think the SPA package contains the Upshot and Metadata html helper extension methods

Remco Ros
  • 1,467
  • 15
  • 31