RIAServices

There are 58 entries for the tag RIAServices
A Fun ValidationAttribute Bug

I tweeted about a bug that I recently helped fix in System.ComponentModel.DataAnnotations.ValidationAttribute. As I said, it's a bug resulting from code I wrote for that class years ago. I was honestly surprised there was any interest in this, but there was! Since I piqued your interest, I thought it only fair that I quench your thirst and show you the details of the bug. I helped fix a bug in System.ComponentModel.DataAnnotations.ValidationAttribute today. A threading bug I introduced a long time ago. :-(— Jeff Handley (@JeffHandley) April 15, 2014 History and Backwards Compatibility The first implementation of ValidationAttribute had a method with the...

posted @ Tuesday, April 15, 2014 1:29 AM | Feedback (2)

Open RIA Services – Let the fun begin!

On September 19th, I made the initial contribution to Open RIA Services, committing the RIA Services codebase. The project is officially under way, giving developers even greater input into a framework that they love and reinforcing existing investments. Right off the bat, I’d like to thank you for your patience during this process. I’d also like to thank Colin Blair, the Open RIA Services project lead, for his patience and persistence. Colin and I reached an informal agreement over 11 months ago that he would be the Open RIA Services project lead if Microsoft would donate the source code...

posted @ Monday, October 14, 2013 8:01 AM | Feedback (1)

RIA Services Silverlight NuGet Packages

As we look forward to the Open RIA Services project, we want to make sure we’re helping lay out a transition for those that desire to make the switch.  As part of that transition plan, we have just published 2 new NuGet packages for RIA Services: the Silverlight Client and the Silverlight DomainDataSource control.  These packages can be used instead of adding references from the WCF RIA Services MSI installation.  By referencing these libraries via NuGet instead of from the MSI, you’ll be better poised to switch to Open RIA Services packages when they exist, and you’ll have fewer dependencies...

posted @ Monday, July 15, 2013 3:21 PM | Feedback (2)

RIA Services is Getting Open-Sourced

It’s about time, right‽  In fact, it has been 3 and a half years since I first declared that getting RIA Services open-sourced was my stretch goal. Since then, I’ve seen dozens of forum posts, hundreds of tweets, and over 13,000 page-views for my original declaration.  There was even a time during a LIDNUG call when Scott Guthrie was directly asked what it was going to take to get RIA Services open-sourced.  This has been an important topic to a lot of people for a long time, and I am finally happy to announce it’s happening! Open RIA Services...

posted @ Wednesday, July 3, 2013 12:49 PM | Feedback (15)

RIA Services NuGet Package Updates – Including Support for EntityFramework 5.0.0

It’s been a long time coming, but we have now published updated and new NuGet packages for RIA Services, including an update to RIAServices.EntityFramework that adds support for EntityFramework 5.0.0 (including all versions >= 4.1). Each of the following NuGet packages was uploaded to nuget.org today with the version number of 4.2.0.  Aside from improving the EntityFramework support with a detailed README, NuGet packaging updates, and the creation of a couple of new packages from existing Toolkit assets, there are no further updates across the features.  I do hope the new and updates packages are helpful though! RIAServices.EntityFramework...

posted @ Monday, December 10, 2012 5:28 PM | Feedback (25)

WCF RIA Services V1.0 SP2 Released

On December 9, 2011, Silverlight 5 was released.  As always, RIA Services is included in the Tools for Silverlight, and this new release included our V1.0 SP2 final build.  We refer to this as our RTW build, meaning Released-To-Web.  In addition to the Tools installer including WCF RIA Services V1.0 SP2, you can also find the standalone installer on Microsoft Download Center.  The silverlight.net/getstarted/riaservices page was also updated to reflect the new release. Aside from some bug fixes here and there, not much changed between SP2 RC and SP2 RTW.  The primary focus as been ensuring really solid compatibility...

posted @ Monday, December 12, 2011 11:04 PM | Feedback (8)

RIA Services updates for //build

At //build, Dinesh Kulkarni from our team gave a presentation alongside Asad Khan from the OData team.  They showed RIA/JS consuming both a RIA Services DomainService as well as an OData feed from Azure.  Dinesh also showed RIA/JS working in the browser, in a Win8 Metro Style app, and on an iPhone using PhoneGap.  You can watch their talk on Channel 9. To coincide with their talk, the RIA Services team published updates for RIA/JS: Updated RIAServices.jQuery NuGet package New RIAServices.jQuery.Sample NuGet package WCF RIA Services Toolkit...

posted @ Friday, September 16, 2011 6:07 PM | Feedback (4)

RIA Services Validation: Available on GitHub

I’ve gotten quite a few requests for the source code behind the RIA Services Validation blog post series.  I am pleased to announce that the code is now published on GitHub. http://github.com/jeffhandley/RIAServicesValidation Within that repository, you’ll find: RudeValidation.Web/Models – Server-side model classes RudeValidation.Web/Validators – Custom validators including CompareValidator, ConditionallyRequired, and DateValidator RudeValidation/Views – Sample screens showing the validation in action RudeValidation/ViewModels - Where you’ll find the sample ViewModel as well as the very simple ViewModelBase If you’re not familiar...

posted @ Tuesday, September 6, 2011 11:50 PM | Feedback (2)

Business Application Project Login / Registration Disables Everything

There is a known issue with WCF RIA Services V1.0 SP2 RC’s Business Application project template.  The issue only surfaces in Silverlight 5, and there’s an easy way to fix it.  We determined the root cause of this issue after it was too late to fix it in time for the RC release, but the correction is in place for the RTW (final) release of SP2. This bug surfaces after you create a new project after installing RIA Services SP2, using the Business Application project template, and then an end user registers or logs in.  After completing the registration/login...

posted @ Saturday, September 3, 2011 3:42 PM | Feedback (5)

WCF RIA Services V1.0 SP2 RC

On September 1, 2011, Silverlight 5 RC was released.  As always, RIA Services is included in the Tools for Silverlight, and that release included our V1.0 SP2 RC build.  And also as always, we published a standalone installer for RIA Services.  You can find it on the download center.  The silverlight.net/getstarted/riaservices page will get updated soon to include the link to this build. This release is one more step toward closing down our SP2 release, and we fixed a number of bugs since SP1.  Some notable differences between SP1 and SP2 are: DateTimeOffset is supported...

posted @ Friday, September 2, 2011 6:25 PM | Feedback (11)

I Get NuGet. You Get NuGet?

Hello, my name is Jeff, and I am addicted to NuGet.   I firmly believe NuGet is one of the best things to come out of Microsoft in a long time, or maybe ever.  NuGet has already transformed the way the RIA Services team releases software.  Now it’s starting to change the way we build our features.  I can envision lots of clever ways to utilize NuGet, but before going crazy, I want a sanity check. tl;dr: Should we go hog-wild with NuGet, or should we keep our focus on the MSI? Releasing Software Starting...

posted @ Thursday, August 11, 2011 12:28 AM | Feedback (15)

Deprecating RIA Services "Live IntelliSense"

WCF RIA Services V1.0 (and V1.0 SP1) included a feature called “Live IntelliSense.”  Live IntelliSense is a feature that you probably didn’t even know about, but you might also take it for granted.  Some people do know about the feature though as it’s caused a few problems, and those affected have had to disable it. What is Live IntelliSense? The easiest way to define the feature is by giving an example of how it applies.  Imagine the following steps are followed when using RIA Services: Add a new DomainService class - call it CustomerService Within...

posted @ Monday, August 8, 2011 3:44 PM | Feedback (4)

RIA Services Endpoints Poll

The RIA Services team is planning out some V2 features.  One common question that keeps coming up as we’re discussing ideas is how much people are using the “extra” 3 endpoints that we provide: OData, JSON, and SOAP. If you don’t know, the official RIA Services product contained the default binary endpoint as well as an OData endpoint.  However, the OData endpoint doesn’t support client-side queries, or the ability to submit changes.  With those limitations, the uses of the endpoint are certainly limited.  The RIA Services Toolkit contains the JSON and SOAP endpoints. My question to you is:...

posted @ Friday, July 8, 2011 6:18 PM | Feedback (14)

RIA Services EF Code First Support

You’ve been asking for it for what seems like forever now, and as of today, it’s available.  That’s right, WCF RIA Services now supports EntityFramework Code First!  Varun Puranik developed the feature, and he has blogged about it, including some very useful Code Snippets.  I recommend going to read his post first, and then coming back here. NuGet Baby! EF Code First support for RIA Services is the first feature where we’re using NuGet as the first distribution mechanism.  Only NuGet offers the ability to release features independently from one another (without flooding your Add/Remove Programs list anyway),...

posted @ Thursday, June 30, 2011 1:00 AM | Feedback (61)

RIA/JS - jQuery client for WCF RIA Services

Today at MIX11, Brad Olenick announced RIA/JS, a jQuery client for WCF RIA Services.  This is an early preview that we want to get your feedback on.  Long before WCF RIA Services V1.0 was released, we started talking RIA Services support for AJAX; in fact, you can see the item here on the RIA Services Wish List (11th ranked as of today).  We hope that you’ll grab this preview and let us know if you like the direction we’re going. RIA/JS Features In today’s state the features are somewhat limited, but many of the basic scenarios are in place: ...

posted @ Wednesday, April 13, 2011 2:42 PM | Feedback (25)

WCF RIA Services - MIX11 Releases

This week at MIX, the RIA Services team has put out two releases: WCF RIA Services V1.0 SP2 Preview (April 2011) Download available here.  This MSI is also included with the Silverlight 5 Beta Tools. Note: you cannot have both SP1 and SP2 installed on your machine.  Installing SP2 will upgrade your machine from SP1 to SP2. This is a Preview-quality release and does not include a Go-Live license.  Here’s what you’ll find within this release: Support for Silverlight 5 Beta - SP1 does not properly perform code generation when...

posted @ Wednesday, April 13, 2011 11:40 AM | Feedback (8)

WCF RIA Services V1.0 SP1

On March 8, Visual Studio 2010 Service Pack 1 was released to MSDN subscribers, and general availability is March 10.  For the WCF RIA Services team, this is especially exciting because our MSI is chained into the installation.  If your machine has the Silverlight 3 SDK on it, then VS 2010 SP1 will install the Silverlight 4 developer runtime, the Silverlight 4 SDK, and WCF RIA Services V1.0 SP1. In addition to our inclusion in VS2010 SP1, our standalone installer has been updated to the RTM release instead of the SP1 Beta.  The changes to http://silverlight.net/getstarted/riaservices are still in...

posted @ Wednesday, March 9, 2011 6:25 PM | Feedback (17)

WCF RIA Services Product and Toolkit Downloads

I heard that with my last blog post that announced the December 2010 Toolkit release, there was some confusion about our Product vs. Toolkit.  I have added clarification to that post, but I wanted to put out another post dedicated to clearing up any confusion I caused. Up until now, the WCF RIA Services team has always published 2 installers with each release: The actual “Product” bits – What gets installed as WCF RIA Services (with a specific version number) The additional “Toolkit” bits – What gets installed as WCF RIA...

posted @ Sunday, December 5, 2010 6:29 PM | Feedback (0)

WCF RIA Services Toolkit December 2010

Up until now, the WCF RIA Services team has always published 2 installers with each release: The actual “Product” bits – What gets installed as WCF RIA Services (with a specific version number) The additional “Toolkit” bits – What gets installed as WCF RIA Services Toolkit The Product installer is where our official product features reside.  This includes our core .NET and Silverlight assemblies such as the LinqToEntitiesDomainService and the Silverlight DomainDataSource control.  The Toolkit is where we’ve put features that we want to distribute but that don’t (yet?) make the...

posted @ Thursday, December 2, 2010 8:59 AM | Feedback (3)

RIA Services Validation: Video Tutorials (in VB)

Not too long ago, a gentleman named Bill Burrows (a VB MVP) contacted me and asked for permission to use content from my blog to create a video tutorial series on RIA Services Validation.  I was really flattered by this and gave him my permission.  I apply a Creative Commons Share-Alike license to the content on my blog, so Bill could have really done this without my explicit permission, but I do appreciate that he asked.  I simply requested that he respect the Share-Alike and Attribution portions of the license. Today, Bill sent me an update to let me...

posted @ Friday, November 19, 2010 9:43 PM | Feedback (0)

DomainDataSource Enum Filters

In early pre-release versions of RIA Services, the DomainDataSource control did not support filter descriptors for Enum properties.  We were able to get this fixed for our V1.0 RC release though, and I mentioned that back in March.  I said in that post that I’d follow up with details about our Enum support, but I never did (until now). Someone actually called me out on this by commenting on the post.  However, I thought the details of the comment were a bit humorous.  Here’s what I received in my inbox: So, you’ve asked me to point...

posted @ Friday, November 19, 2010 6:10 PM | Feedback (0)

RIA Services SP1 Installation Note

With our WCF RIA Services V1.0 SP1 Beta release, we have a known installation issue that we wanted to call out.  In actuality, the issue is not with our SP1 installer, but with our V1.0 RTM installer, but it doesn't surface until you've installed SP1. To get right to the point: If you have WCF RIA Services V1.0 SP1 installed, do not attempt to install WCF RIA Services V1.0 RTM.  If you do, you will find yourself in this strange scenario where both V1.0 RTM and V1.0 SP1 appear to be installed.  What you really have is a union...

posted @ Thursday, November 18, 2010 4:54 PM | Feedback (0)

Is Silverlight's DataAnnotations a Subset of .NET's?

I was one of the developers that ported the System.ComponentModel.DataAnnotations assembly to Silverlight.  Every once in awhile, someone asks me if the Silverlight version of the assembly is a subset of what is in .NET.  The answer is Yes, but there are some caveats, and I’m honestly tired of regurgitating the detailed answer.  With this blog post in place, I can now simply point people to a URL for the answer.  This is what we call DRY. I’m sure that it goes without saying that the implementation details of the two assemblies differ.  In the .NET version, we have...

posted @ Tuesday, November 16, 2010 1:39 PM | Feedback (1)

Our Apologies to One Guy

Last week, I tweeted about a bug the RIA Services QA team found.  It’s rather obscure and we decided not to fix it.  I thought it was worth mentioning for at least the humor of it. Here’s what you must be using in order to see this issue: Windows XP Service Pack 3 - Japanese Visual Web Developer 2010 Express - Japanese WCF RIA Services V1.0 SP1 Beta (or RTM, since we won’t be fixing the issue) VB And here’s what you do: ...

posted @ Monday, November 15, 2010 2:53 PM | Feedback (1)

RIA Services T4: Walk-Up Experience

UPDATE: The RIA Services team released a December 2010 Toolkit, and that release fixes the build issues encountered below.  But this post still has value as it shows some ways to modify the code generated by our T4 Code Generator.  Be sure to check out Varun Puranik’s Blog for more details on the December 2010 update. The RIA Services T4 Code Generation feature was checked in about 3 hours before we published our MSI for today’s release.  Talk about publishing an experimental feature!  So tonight, I decided to take the app that I’ve been working on for...

posted @ Thursday, October 28, 2010 2:44 AM | Feedback (19)

WCF RIA Services V1.0 SP1 Beta

BAM! This is an exciting day; today we are releasing WCF RIA Services V1.0 SP1 Beta and WCF RIA Services Toolkit October 2010.  These download links are also available from http://silverlight.net/riaservices. Side-by-side installation with WCF RIA Services V1.0 is not supported.  If you already have RIA Services installed on your machine, you should: Uninstall WCF RIA Services Toolkit Uninstall WCF RIA Services V1.0 for Visual Studio 2010 Install WCF RIA Services V1.0 SP1 Beta Install WCF RIA Services Toolkit October 2010 ...

posted @ Wednesday, October 27, 2010 8:26 PM | Feedback (40)

RIA Services Validation: Using ValidationContext (Cross-Entity Validation)

In our last post, we learned how ValidationContext can be used to provide and consume state and services for validation methods to use.  Now, let’s take a quick look at how validation methods can actually use this information.  I’m going to include a bunch of code in this post, and I will rely on the code to be rather self-explanatory. Property-Level Validation In this property-level validation example, we need to validate that the location entered for a meeting is a valid location from our database.  We want this to work both on the server and on the client,...

posted @ Monday, October 25, 2010 1:56 AM | Feedback (20)

RIA Services Validation: Providing ValidationContext

Throughout this series on RIA Services Validation, I’ve mentioned and shown ValidationContext several times.  In this post, we’ll learn about the purpose of ValidationContext, what types of context it can provide, and how it integrates with RIA Services.  This will allow us to explore further topics such as cross-entity validation and open the door for other advanced validation scenarios. ValidationContext Purpose Although ValidationContext exists within the System.ComponentModel.DataAnnotations assembly in both .NET 4.0+ and Silverlight 3+, the class was introduced by the RIA Services team.  While designing the RIA Services validation system, we considered scenarios where validation logic is...

posted @ Monday, October 25, 2010 12:49 AM | Feedback (7)

RIA Services Validation: Entity-Level Validation

In my last post, I went over some cross-field validation scenarios and provided some sample code, including a CompareValidatorAttribute.  We’ve now covered single-field validation and cross-field validation, but there’s yet another level of validation supported by RIA Services—Entity-Level validation.  As you’ll see in this post, entity-level validation is very similar to what we’ve already seen. Entity-Level Validation Declaration Your entity types can declare entity-level validation using either the [CustomValidation] attribute approach where a custom validation method is supplied, or by having an attribute that derives from ValidationAttribute.  Either way, to indicate that a validation rule applies at the...

posted @ Tuesday, October 12, 2010 1:31 AM | Feedback (7)

RIA Services Validation: Cross-Field Validation

I frequently hear questions about how to perform cross-field validation in RIA Services.  Before thoroughly covering this topic*, I wanted to be sure to go through some simple scenarios, show how to use CustomValidationAttribute, how to derive from ValidationAttribute, explain how validation rules are propagated to the client, and what triggers the validation.  Hopefully by now, you’re getting pretty comfortable with the validation framework and you’re ready to explore some more examples. * Perhaps you noticed that I snuck a reusable cross-field validator into the Custom Reusable Validators post—it’s a rather useful ConditionallyRequiredAttribute. In this post, I’m going...

posted @ Sunday, October 10, 2010 1:29 AM | Feedback (4)

RIA Services Validation: Validation Triggers

My goal with this blog post series is to provide an end-to-end tour of how RIA Services validation works and how you can leverage its capabilities to build rich, responsive applications.  A key factor for making the most of validation is fully understanding when and how RIA Services invokes your validation rules.  Awareness of the various validation triggers will help you implement your validators so they are fired as you expect, when you expect.  In this post will dig into the RIA Services codebase and identify every place where entity validation is invoked. Client-Side Validation Property Setters –...

posted @ Wednesday, October 6, 2010 3:48 AM | Feedback (2)

RIA Services Validation: Attribute Propagation

Since the beginning of the RIA Services project, a primary tenet was to propagate validation rules defined on the server up to the client, integrating the validation directly into the Silverlight UI.  This came to fruition with RIA Services v1.0 and you can in fact apply an attribute to your model on the server and automatically get instant client-side validation of data entry on even the simplest of Textbox controls.  In fact, some validation rules are inferred from your data model directly.  This is a feat that many other frameworks have attempted to accomplish, but I believe RIA Services has...

posted @ Thursday, September 30, 2010 2:37 AM | Feedback (2)

RIA Services Validation: Custom Reusable Validators

We just covered Custom Validation Methods, where we learned how to use CustomValidationAttribute to invoke a static (VB: Shared) method to perform validation.  Let’s talk about an alternate approach to custom validation though: creating custom, reusable validators by deriving from ValidationAttribute.  While it’s true that the custom validation methods used by [CustomValidation] could certainly be reusable, I tend to think of that approach as a light-weight way to call specific business logic routines for validation.  The approach we’re about to see is what I use when I’m creating an inventory of validators to be reused throughout my project(s). Deriving...

posted @ Sunday, September 26, 2010 3:39 AM | Feedback (7)

RIA Services Validation: Custom Validation Methods

In our last installment, we learned about the standard validators that ship in the System.ComponentModel.DataAnnotations assembly.  RequiredAttribute, RangeAttribute, StringLengthAttribute, and RegularExpressionAttribute all derive from ValidationAttribute and cover many common validation scenarios.  Every system has its own business rules though, and therefore it’s imperative that RIA Services allows you to create custom validators to implement your own logic.  Moreover, your custom error messages must plug into the same framework that powers the standard validators.  To address this requirement, we added CustomValidationAttribute. Using CustomValidationAttribute to Invoke a Method System.ComponentModel.DataAnnotations.CustomValidationAttribute allows you to easily redirect a validator to a method you’ve...

posted @ Saturday, September 25, 2010 11:12 PM | Feedback (2)

RIA Services Validation: Standard Validators

RIA Services offers powerful features for flowing validation from your entity model all the way up to the Silverlight UI.  In fact, flowing your validation rules from the server into your form controls was one of the primary tenets of RIA Services V1, and our team did the work of getting validation integrated deeply into Silverlight, long before RIA Services was released.  In this post we’ll take a look at the standard validators that are offered. System.ComponentModel.DataAnnotations.ValidationAttribute RIA Services employs the ValidationAttribute class from System.ComponentModel.DataAnnotations for defining validation rules on your entity model.  ValidationAttribute itself is abstract (VB:...

posted @ Wednesday, September 22, 2010 3:16 AM | Feedback (4)

DomainDataSource, ComboBox, and Load Blocking

Over on our forums, many of you have reported difficulty with the ComboBox control when using RIA Services.  Kyle McClellan (@KyleMcClellan) suggested that we drill into various ComboBox scenarios to see what works well and what doesn’t.  Our goal was to produce some samples that address common scenarios, and to offer general guidance for ComboBox usage. Here are a few scenarios we looked at: Async loading of ItemsSource with a SelectedItem/SelectedValue binding; Cascading drop-downs such as selecting Year - Make - Model for a car; Binding...

posted @ Tuesday, June 22, 2010 2:36 AM | Feedback (9)

Async Validation with RIA Services

Almost a year ago, I posted a lengthy article on how to implement Async Validation with RIA Services and DataForm.  It was hard; much harder than it should have been, and we all knew it.  Since then, things have changed, and async validation is a lot simpler.  Let’s take a look at why it’s easier and how you can easily perform async validation in your application. INotifyDataErrorInfo Silverlight 4 shipped with an interface called INotifyDataErrorInfo, and controls that previously supported validation by way of exceptions now support async validation through this interface.  This laid the groundwork for RIA...

posted @ Wednesday, May 26, 2010 1:06 PM | Feedback (32)

RIA Services V1.0 and Beyond

I came to Microsoft 2 years ago to join project Alexandria, which had the goal of making Silverlight an approachable framework for building business applications.  The domain really excited me and it’s been an honor to work on this product.  In case you’ve been living under a rock, we released the official 1.0 version of RIA Services back on May 17th.  Here are some links to announcements that I’m sure you’ve already seen. Scott Guthrie Nikhil Kothari Tim Heuer Silverlight.TV Episode 28 (WCF RIA...

posted @ Monday, May 24, 2010 3:39 PM | Feedback (2)

RIA Services - Documentation Guidance and Community Samples

As the RIA Services team is wrapping up our V1 release, several team members have been diving into the forums, writing blog posts, and in general trying to connect with the community to make sure we’re tying up all of our loose ends.  We would also like to make sure that we have our documentation bases covered, but we’d like to solicit some candid feedback for this area in particular. Documentation Approaches What forms of documentation would you like to see us work on?  Do you like quick-start tutorials, or do you prefer deep-dives?  How would you prioritize...

posted @ Tuesday, March 30, 2010 7:20 PM | Feedback (11)

Writing a Custom Filter or Parameter for DomainDataSource

This post comes to you from a guest writer, Kyle McClellan.  Kyle works with me on the RIA Services team and he’s contributed to the DomainDataSource feature (among many other features in the framework).  Kyle made the changes that allowed us to remove ControlParameter and use ElementName bindings for FilterDescriptor and Parameter that I recently blogged about. Now that the ControlParameter has been properly disposed of, you might have noticed that Parameter has changed substantially. Before, a Parameter was used for filtering, grouping, sorting, and querying. Now it is only used in the last case. If you...

posted @ Thursday, March 18, 2010 4:14 PM | Feedback (4)

DomainDataSource Filters and Parameters

Of all changes that made it into the RIA Services RC release, one of the ones that I'm happiest about is the deletion of a class called ControlParameter.  Yes, ControlParameter is gone, gone, gone--finally!  If you’re wondering how you’ll get your UI-based filters and parameters to work without ControlParameter, do not fret… it’s easy; just use an ElementName binding! Let’s take a look at the changes related to Filters and Parameters… ControlParameter is gone… Good Riddance! Since the inception of RIA Services, the DomainDataSource control has relied upon ControlParameter tags for specifying Filters and Query Parameters that...

posted @ Monday, March 15, 2010 7:24 PM | Feedback (26)

ContosoSales Application for RIA Services RC

With the release of the RIA Services Release Candidate, it was time to refresh the ContosoSales application that was first shown in the PDC keynote.  Let’s take a look at the changes made to move to the new release. The steps below are based on having downloaded the styled ContosoSales application from PDC.  If you want to cut to the chase and download the new version of the solution, you can grab it here for use with the RIA Services RC bits. Changes to References In trying to migrate the application, the first thing we notice is...

posted @ Monday, March 15, 2010 1:20 PM | Feedback (7)

Lookups in DataGrid and DataForm with RIA Services

While off reading random blog posts on the tubes, I stumbled upon a post that describes a 101-level scenario of using lookup data in the DataGrid and DataForm with RIA Services.  The author was struggling to find a solution for the problem and was clearly frustrated. The scenario is very common; let’s use the Cars example where every Model refers to its Make. We want a DataGrid that includes the make name as a column: And we want a DataForm with a ComboBox for the Make:   ...

posted @ Friday, March 12, 2010 5:38 PM | Feedback (31)

ValidationResult - Specifying Member Names

The System.ComponentModel.DataAnnotations.ValidationResult class was created for RIA Services, and it was introduced in Silverlight 3.0 and then added into .NET 4.0.  A ValidationResult represents a validation error condition, specifying the error message and, optionally, any member names that the error corresponds to.  If you use the [Required] attribute, the [Range] attribute, [StringLength], or any of the other provided ValidationAttribute classes, then ValidationResult instances are created to represent any validation failures.  If you have used the [CustomValidation] attribute or if you have derived from ValidationAttribute yourself, you have likely returned an instance of ValidationResult in your code, or ValidationResult.Success if validation...

posted @ Wednesday, February 24, 2010 11:42 PM | Feedback (7)

My Stretch Goal: To Ship RIA Services Source Code

When I laid out my commitments for the current fiscal year, I included “Ship RIA Services Source Code” as a stretch goal.  Pulling this off will require a ton of effort.  I’ll have to work with management up several levels, with our legal department, and with dozens of others to pull it off.  There will also be a very significant amount of engineering required to make it happen too.  So I’m trying to figure out how valuable this would be to our customers. Please go rate the value here: http://twtpoll.com/zfln78 I’d also like to hear comments backing up...

posted @ Thursday, January 21, 2010 12:14 AM | Feedback (11)

(Not) Doing Back Flips with DomainDataSource [SubmitChanges sends user to first page]

When changes are successfully submitted and you have paging enabled, it’s quite possible that some of the entities that have been edited now belong to a different page.  Say for instance you are viewing employees ordered by last name, and you edit one of the employees to change their last name, moving them from Jones to Adams.  After submitting changes, what should happen?  Should Adams continue to show up on the 6th page, or should the data be refreshed to place everyone where they belong? A few months ago, we made the decision to invoke a fresh load after...

posted @ Saturday, November 21, 2009 9:40 AM | Feedback (3)

DomainDataSource Error Handling

With the RIA Services July 2009 Preview release, we heard significant feedback about the DomainDataSource error handling story.  The biggest problem was when errors occurred during Load() or SubmitChanges(), server-side errors would be silently swallowed unless you opted into the LoadError, LoadedData, and SubmittedChanges events, and explicitly checked for errors.  With the PDC release, we've change this behavior, among others related to error handling. Different Error Conditions The DomainDataSource can encounter errors in several different ways: Load() is called when its prerequisites are not yet met.  For instance, there is no DomainContext specified, the...

posted @ Thursday, November 19, 2009 8:29 PM | Feedback (21)

Building ContosoSales - The RIA Services Keynote Demo

During Scott Guthrie’s keynote at PDC09 (starting around 1:28:00), Scott Hanselman presented a demo that highlighted Visual Studio 2010, Silverlight 4, RIA Services, and lots of great new tooling that ties all of these products together.  I wanted to show you how you can build the same application using installations that are available today. Machine Setup You’ll need to install Visual Studio 2010 Beta 2 if you haven't already.  If you have a previous release of RIA Services already installed, you’ll need to uninstall it before proceeding.  Please note that you want to keep the Silverlight 3 SDK installed...

posted @ Wednesday, November 18, 2009 10:04 AM | Feedback (16)

DomainDataSourceView API (DomainDataSource.DataView)

DomainDataSource has two properties for getting the data out of it: Data and DataView.  The Data property is what’s intended for exposure in Binding scenarios, for instance binding a DataGrid to the DomainDataSource.  This property is typed very simply as an IEnumerable.  The DataView property however is intended to be used for programmatic access to the entities exposed by the DomainDataSource.  While the two properties currently return the same collection instance, this might not always be true, so it’s good to properly set the expectations of these two properties.  If you need to work with the collection from the DomainDataSource,...

posted @ Monday, November 16, 2009 3:58 PM | Feedback (4)

DomainDataSource DataPager PageSize Pitfall

During the PDC release milestone of RIA Services, we discovered an error from DomainDataSource when using AutoLoad="True" and when using a DataPager bound to the DomainDataSource’s Data property.  We found that when the PageSize property is specified on the DataPager and not on the the DomainDataSource itself, an exception would often (but not always) be thrown from DomainDataSource, indicating that a load could not be invoked while another load was in progress.  The reason for this will actually interest you most if you use AutoLoad set to False. The issue is easiest to explain with a series of events...

posted @ Monday, November 16, 2009 3:12 AM | Feedback (5)

DomainDataSource – Single Record Results

While the DomainDataSource is most often used for loading entire sets of records, it can also be used for loading a single record result.  This is a topic I’ve seen a few people talk about, assuming it’s a difficult thing to do, and even creating solutions for a problem that doesn’t exist.  I want to dispel the myth here: DomainDataSource can in fact be used to easily bind to a single record result. Let’s create a DomainService that has a method to get the most recent error from the AdventureWorks database: ...

posted @ Tuesday, November 10, 2009 10:33 AM | Feedback (2)

Add/Remove with DataForm and RIA Services

Note: The limitations discussed herein no longer apply once you get WCF RIA Services V1 SP1 Beta (or later). See Kyle McClellan's blog for more info. Tom Beeby posted a topic on the RIA Services forums about adding a new entity via the DataForm buttons.  Specifically, he pointed out a problem where the DataForm does not light up the Add/Remove buttons when bound to an EntityList from your DomainContext.  To exacerbate the problem, it turns out that binding to an EntityCollection<T> from RIA Services won’t let you Add or Remove either.  I’ve dug into this problem with some team members,...

posted @ Friday, August 14, 2009 1:50 AM | Feedback (30)

DomainDataSource.DataView

There have been a couple of discussions on the .NET RIA Services Forums regarding the DomainDataSource.DataView property.  Colin Blair tossed in a comment that relates to something we’re working on: This looks like as good a place as any to say I would like to see the actual object behind IEditableCollectionView exposed publically. … Right now, the DomainDataSource’s Data and DataView properties are returned as interfaces: Data is an IEnumerable, and DataView is an ICollectionView.  But behind the scenes, both of these properties return an instance of an EntityCollectionView,...

posted @ Tuesday, July 21, 2009 5:41 PM | Feedback (3)

DomainDataSource – Defining Its Limits

With the .NET RIA Services July 2009 Preview, the DomainDataSource now enables some scenarios that were previously blocked.  Most namely, we now allow you to change your current page while there are pending changes in the data.  Editing and paging seemed like a common enough scenario that we wanted to enable it, so we’ve done so in the recent drop. There are actually many scenarios opened up right now that we’re reviewing.  I’ll be frank: many of the following scenarios are probably doing really wonky things in the current bits.  So here’s your chance to help us determine how these scenarios...

posted @ Tuesday, July 14, 2009 3:45 AM | Feedback (15)

Async Validation with .NET RIA Services and DataForm

Please note… this post is out-dated and all of the madness below is no longer needed in order to implement Async Validation with RIA Services.  Please see the new post for the current approach. The Birth of QuickSilverlight.Validation Over on the .NET RIA Services forums, “SilverlightRIA” asked about performing asynchronous validation with .NET RIA Services and the Silverlight Toolkit’s DataForm.  He wanted to intercept the Commit from the DataForm and invoke his async validation, integrating the results into the DataForm’s validation UI.  This was an interesting scenario so I put some time into a solution for it this week.  The result is...

posted @ Saturday, July 11, 2009 5:05 AM | Feedback (9)

Validation Exceptions in Silverlight

With the Silverlight 3 Beta SDK and .NET RIA Services, a lot of people are starting to utilize the System.ComponentModel.DataAnnotations library to add validation metadata to their entities.  Something that has tripped up some people is the use of exceptions for validation errors, where Visual Studio breaks with a user unhandled exception. As Keith Jones reported, Silverlight 3 uses exceptions to notify controls when validation has failed.  This means that many users will see Visual Studio break when these exceptions occur and be led to believe something has gone wrong.  But everything’s doing what it should.  If you hit...

posted @ Wednesday, April 1, 2009 10:33 AM | Feedback (6)

.NET RIA Services – Implementing Custom Interfaces

.NET RIA Services allows you to write code on the server in an ASP.NET project, and have it available within a Silverlight application hosted by that web project.  Using build-time code generation, your entity types in the server project become available within the client project.  You can get .NET RIA Services today and provide feedback on the forums. Well, I am working on a scenario where I needed to have an entity implement a custom interface on both the server and the client.  I immediately wondered, “How on Earth will the code generation know to propagate my interface implementation...

posted @ Monday, March 30, 2009 1:49 PM | Feedback (6)

Silverlight 3 and .NET RIA Services

Ever since I started at Microsoft, I’ve been part of a team working to deliver a lot of things that are hitting the streets today.  It’s been a wild ride and it’s great to see our work going public. Here is some of what is most exciting for me to see in public: .NET RIA Services Validation Navigation ChildWindow There’s going to be a lot to take in over the next couple of days with the MIX sessions, but I look forward to...

posted @ Wednesday, March 18, 2009 1:10 PM | Feedback (0)