Is it possible to bind a WPF combobox control to an OData source and if so how does one do it?
In Binding Data to Controls (WCF Data Services) Microsoft has documented how to do this.
Related
my first question on StackOverflow, so apologies if not perfect right from the beginning ...
My question is actually two-fold:
Can I have the LightSwitch ApplicationData service (or any other internally defined Data Source) define ODATA actions on the service level or entity set/entity level? If yes, how do I do that? (I cannot find the route information in the application where I could override/add that.)
How would I consume these actions from the client side (via the built-in MS JS object model in msls or via screen/entity)? Even, if LightSwitch itself could not create/would not support actions, I would still like to know how to consume them from the client side, as we are exposing external ODATA data sources via LightSwitch to the client (and these ODATA source have actions defined).
I know I can use jaydata from the client side to consume that and execute actions on an ODATA source, but I would like to know if LightSwitch has built-in support for that.
Further information: we are using VS/LS 2013. And Silverlight is not an option, we only use the HTML client.
Thank you very much for your support and hints!
Regards, Ronald
There is nothing built-in to LightSwitch that lets you define custom OData actions on the service side or consume them from the client side. You'd need to use standard web functionality like ASP.NET's WebAPI and your favorite JavaScript OData library, like JayData.
Does Linqpad use OData (WCF Data services) client library to generate the proxy that'll call the Data service OR does it use plain http/REST? Since it was getting strongly typed context, which can be used for the queries, I assume its using a proxy?
If its the former, is there a way to update the OData client library to be used by Linqpad?
LINQPad uses EntityClassGenerator in System.Data.Services.Design to generate the client proxy classes. This class is a standard part of the .NET Framework - I'm not aware of an updated OData client library... is there one?
Edit: LINQPad now supports OData 5 (from version 4.42.06).
I am trying to build a OData interface for Java application.
From what I have seen, one can create fully compliant OData services using microsoft technologies (aka visual studio) using their WCF services. Am I of the right impression?
I am trying to simulate OData services (it is also RESTful) using RESTlet + ROME(for atom feeds) + ROME Propono (for atompub service document). OData specification says that I canm access individual objects of a collection like http://mysite/service.svc/products(1)
Is there a way to represent this in RESTlet?
router.attach("products(id)") will not work
router.attach("products/get/{id}") is not really OData like.
Do you have any suggestions? Am I even doing it right?
Regards,
D
Have you tried this URI template?
router.attach("products({id})")
I recently got into Silverlight development. So far I've managed to create a single Silverlight XAML view which pulls in data from an SQL Server Database using the ADO.Net Entity Framework and displays the data in a Silverlight DataGrid. I can also perform simple editing and update functionality on the data and persist it back to the database. At this point my understanding fails. From what I gather, the Silverlight Client Application is hosted inside an ASP.NET or ASP.Net MVC web application. Normally I would just build a website using ASP.Net MVC and use a few jQuery controls, etc., to spice up the interface on each view. How do I go about using these different Silverlight XAML views that I create in my ASP.Net MVC application like they were MVC Views? Have I totally missed something here?
RIA Models
There are two different models for integrating Silverlight (or any RIA technology) into your website:
Entire Silverlight application hosted in simple website
Silverlight controls integrated into a website with other interaction (forms, jQuery, etc.)
Either model works well, it's up to you to decide which works better in your scenario.
Silverlight communication with the server
Your Silverlight application is a plugin hosted in a browser, so it's best to think of it like jQuery or other client-side code. There are several ways to communicate back to the server:
RIA Services
ADO.NET Data Services
Custom WCF service
Other REST / SOAP communications you build yourself
Silverlight supports WebClient and HttpWebRequest, so you can get as low-level as you'd like in your client-server communication. I really recommend looking at RIA Services since it handles not only the communications, but also the validation rules.
Silverlight integration with HTML / Javascript
Silverlight can both call and be called from Javascript via the HTML bridge. This means that your Silverlight components can be as closely integrated with your web-page as you'd like. Silverlight can also directly interact with the DOM - setting and reading form values, changing CSS properties, etc. You can do just about anything you'd do in Javascript via the HTML bridge if you'd like.
In order to update your data model from your Silverlight application (which is running on your client's machine) is to utilize WCF (Windows Communication Foundation). Your Silverlight application will communicate to your server using WCF, and none of that has really anything to do with how you're serving up your Silverlight app (whether you're using Webforms or MVC).
I have a prototype ASP.NET-MVC website which uses Ninject as a IoC container. All service-classes and repository-classes used by MVC Controllers are properly injected by Ninject. This is great.
The next thing I need to add there is Silverlight (version 3 to be more precise).
Silverlight will be connecting to my server using WCF service, hosted in ASP compatibility mode, to the same ASP.NET-MVC website.
What Silverlight needs is to 'download'/'get' a kind of ViewModel using WCF (the better name would be Client-Side Model). This is also possible - I imported WCF service and setup all security-related xml configuration files.
Here is the stuff I want to know....
Is that OK that model returned by WCF service is rather complex and includes arrays and inheritance (at array items' level)... or maybe there is another and better way to send it from server to client?
At Server-Side for regular asp-mvc stuff all service-classes used by controllers are injected by Ninject. How to inject services for WCF-service classes?
Do WCF service has an access to HttpContext.Current.Items? I need to grab from here logged User Id and a few profile-related data (regular forms auth. stuff).
EDIT
Ad 3. It's possible enabling AspNetCompatibilityRequirements
Has anybody ideas for point 2?
For the 1st Question.
Yes it is okay to return a complex structure, provided you have explicitly applied the '[DataMember]' attribute to each and every needed property of the Object/s.