Category Archives: Blog

Content from WCF RIA Services Presentation

Here is the slidedeck and sample demo from the talk I have been doing recently covering WCF RIA Services.

 

Thanks to all of the great developers that have watched this talk. It is a very fun topic to present on.

Video: Embracing Your Failures (CodeStock 2010)

I had the privilege of giving a talk that I have been working on for some time. Entitled “Embracing Your Failures”, I wanted to share with others that failure is OK as long as you learn from it and also some ways I learn from my failures. Thanks to the folks at the CodeStock conference for selecting the talk, David Giard for recording and producing the video and also the dozen or so people that attended the talk on Saturday June 26, 2010 in Knoxville.

Part 1

Part 2

Slidedeck from talk — http://tinyurl.com/embracingfailure-deck

Content from the OData Workshop Tour

Here is the list of the files and links to projects that I have used as demos for my OData Workshop so far in Chicago.

Slidedecks

Databases

Demo Projects

Applications used in Workshop

Thanks to everyone that has attended my OData Workshops. They have been fun and I have enjoyed meeting so many great people.

OData Blowout in June… 8 OData Workshops in Raleigh, Charlotte, Atlanta, Chicago and NYC

odata

Interested in OData? Want to discover what the next revolution in data will be? In this workshop, the attendee is invited to consider the many opportunities and challenges for data-intensive applications, interorganizational data sharing for “data mashups,” the establishment of new processes and pipelines, and an agenda to exploit the opportunities as well as stay ahead of the data deluge. 

June 2 – Raleigh, NC

June 3 – Charlotte, NC

June 4 – Atlanta

June 21 and 22 – Chicago (downtown and suburbs)

June 28 – NYC

Abstract

The Open Data Protocol (OData) is an open protocol for sharing data. It provides a way to break down data silos and increase the shared value of data by creating an ecosystem in which data consumers can interoperate with data producers in a way that is far more powerful than currently possible, enabling more applications to make sense of a broader set of data. Every producer and consumer of data that participates in this ecosystem increases its overall value.

OData is consistent with the way the Web works – it makes a deep commitment to URIs for resource identification and commits to an HTTP-based, uniform interface for interacting with those resources (just like the Web).   This commitment to core Web principles allows OData to enable a new level of data integration and interoperability across a broad range of clients, servers, services, and tools.

OData is released under the Open Specification Promise to allow anyone to freely interoperate with OData implementations.

In this talk Chris will provide an in depth knowledge to this protocol, how to consume a OData service and finally how to implement an OData service on Windows using the WCF Data Services product.

Agenda

· Introductions (5 minutes)

· Overview of OData (10 minutes)

· The OData Protocol (1 hour)

· 15 minute break

· Producing OData Feeds (1 hour)

· Consuming OData Feeds (1 hour)

Bio

Chris Woodruff (or Woody as he is commonly known as) has a degree in Computer Science from Michigan State University’s College of Engineering. Woody has been developing and architecting software solutions for almost 15 years and has worked in many different platforms and tools. He is a community leader, helping such events as Day of .NET Ann Arbor, West Michigan Day of .NET and CodeMash. He was also instrumental in bringing the popular Give Camp event to Western Michigan where technology professionals lend their time and development expertise to assist local non-profits. As a speaker and podcaster, Woody has spoken and discussed a variety of topics, including database design and open source. He is a Microsoft MVP in Data Platform Development. Woody works at RCM Technologies in Grand Rapids, MI as a Principal Consultant.

Woody is the co-host of the popular podcast “Deep Fried Bytes” and blogs at www.chriswoodruff.com. He is the President of the West Michigan .NET User Group and also is a co-founder of the software architecture online portal nPlus1.org.

Woody has worked in many arenas throughout the years, including healthcare, manufacturing, publishing, promotion execution and the automotive industry. He has experience with starting and running new ventures, including past work with technology startups. Woody continues to develop his expertise by learning & developing new technologies to better meet the needs of his clients, while devoting his free time to improving the development community at large, and giving back to the community in which he lives.

WCF Data Services Friendly Feeds and Issues with EntityPropertyMapping (EPM)

I was trying to get friendly feeds working for the baseball stats OData feed (WCF data Services). I use Orcsweb’s current .NET 4 beta accounts to host the project. I am trying to have Friendly Feeds for the OData feed so they can be easier to display data from all browsers. This involves feed customization like Phani blogged about here:

http://blogs.msdn.com/phaniraj/archive/2009/03/28/ado-net-data-services-friendly-feeds-mapping-edm-types-i.aspx

I tried customizing a few EntityTypes in the EDMX and tested locally to get the correct Titles for each entity produced in the feed. Below is an example for having the TeamFranchise.franchName be the Title for each entity in the AtomPub result set:

<EntityType Name="TeamFranchise">
  <Key>
    <PropertyRef Name="franchID" />
  </Key>
  <Property Name="franchID" Type="String" Nullable="false" MaxLength="3" Unicode="true" FixedLength="false" />
  <Property Name="franchName" Type="String" MaxLength="50" Unicode="true" FixedLength="false"
    m2:FC_TargetPath="SyndicationTitle"
    m2:FC_EpmContentKind="Plaintext"
    m2:FC_EpmKeepInContent="true" />
  <Property Name="active" Type="String" MaxLength="2" Unicode="true" FixedLength="false" />
  <Property Name="NAassoc" Type="String" MaxLength="3" Unicode="true" FixedLength="false" />
  <NavigationProperty Name="Teams" Relationship="BaseballStatsModel.FK_Teams_TeamsFranchises" FromRole="TeamFranchise" ToRole="Team" />
</EntityType>
<EntityType Name="TeamHalf">
  <Key>
    <PropertyRef Name="yearID" />
    <PropertyRef Name="lgID" />
    <PropertyRef Name="teamID" />
    <PropertyRef Name="Half" />
  </Key>
  <Property Name="yearID" Type="Int16" Nullable="false" />
  <Property Name="lgID" Type="String" Nullable="false" MaxLength="2" Unicode="true" FixedLength="false" />
  <Property Name="teamID" Type="String" Nullable="false" MaxLength="3" Unicode="true" FixedLength="false" />
  <Property Name="Half" Type="String" Nullable="false" MaxLength="1" Unicode="true" FixedLength="false" />
  <Property Name="divID" Type="String" MaxLength="1" Unicode="true" FixedLength="false" />
  <Property Name="DivWin" Type="String" MaxLength="1" Unicode="true" FixedLength="false" />
  <Property Name="Rank" Type="Int16" />
  <Property Name="G" Type="Int16" />
  <Property Name="W" Type="Int16" />
  <Property Name="L" Type="Int16" />
  <NavigationProperty Name="Team" Relationship="BaseballStatsModel.FK_TeamsHalf_Teams" FromRole="TeamHalf" ToRole="Team" />
</EntityType>

I deployed to the Orcsweb’s webservers that are hosting with .NET 4.0 RC and attempted to get results from the following call:

http://173.46.159.199/baseballstats/BaseballStats.svc/TeamFranchises

I received the following error:

The server encountered an error processing the request. The exception message is ‘Attempt by method ‘System.Linq.Expressions.Expression.CreateLambda(System.Type, System.Linq.Expressions.Expression, System.String, Boolean, System.Collections.ObjectModel.ReadOnlyCollection`1<System.Linq.Expressions.ParameterExpression>)’ to access method ‘System.Linq.Expressions.Expression`1<System.Func`3<System.Object,System.Data.Services.Providers.DataServiceProviderWrapper,System.String>>.Create(System.Linq.Expressions.Expression, System.String, Boolean, System.Collections.ObjectModel.ReadOnlyCollection`1<System.Linq.Expressions.ParameterExpression>)’ failed.’. See server logs for more details. The exception stack trace is:

Checking with the Data Services team this is a known issue involving EntityPropertyMapping (EPM). The issue involves having the Service in a partial trust environment like many web hosting providers have with shared hosting accounts. The only way this Feed Customization can work is when the Service has full trust. There is no workaround at this time. They seem to be working on a solution but they could not get it into this release.

So this will cause some discomfort if people developing OData need to make changes to the EPM.

The feed at http://173.46.159.199/baseballstats/BaseballStats.svc/ has been reverted back with no Feed Customization in order for people to continue to test with the feed.

OData does not support Select Many Queries

Over the weekend a fellow developer asked me about how to get a query result from OData using the OData feed from last week’s MIX10 conference http://api.visitmix.com/OData.svc to accomplish the following: “give me all sessions with an WMV that are tagged Silverlight”

I started looking at it and tried to create a LINQ statement for what I thought would be the solution. This was after playing around with the MIX10 OData feed in the Silverlight OData Explorer and not finding a correct URI statement that gave me the result set I was looking for.

The LINQ statement I thought would work is:

from f in Files
from s in f.Sessions
from t in s.Tags
where f.TypeName == "WMV" && t.TagName == "Silverlight"
select f.Url

After discussing it with several people in Redmond, they gave me a A-Ha moment. Here is the dialog we had:

If you are trying to select many from OData the OData backend must be able to detect a predicate that can become a key selector for the query.

i.e.

from f in Files
from s in f.Sessions
from t in s.Tags
where f.Id == <value>
select s

is fine because f.Id is recognized as the key for Files related to the Sessions from the MIX conference.

This however:

from f in Files
from s in f.Sessions
where f.Name == “”
select s; 

will fail because f.Name is not a key selector.

If you think about this in terms of URL’s having to have this key selector for your queries is definitely needed. Whenever you go from one segment to another in the URL you have to have to identify just one item first…

So this query works:

http://api.visitmix.com/OData.svc/Files(guid’98c77821-982f-4670-8848-001cd763ffbf’)/Sessions

Because you have selected an individual file, before navigating to sessions.

But this is no good:

http://api.visitmix.com/OData.svc/Files/Sessions?$filter=Files/Name eq ‘ ’

because you have multiple files when you try to navigate.

Announcing the MEF Contrib Documentation Project

A few weeks ago I had the idea of taking the current documentation on the Managed Extensibility Framework (MEF) Codeplex site and creating a PDF that I could read on my Kindle DX to learn MEF. I did the next obvious thing and tweeted about the document for MEF Development I just created. I was surprised how many people asked for the document and if I could send it to them. I uploaded it to my personal site here. A few days later I was in discussions with Glenn Block, one of the masterminds behind MEF, about leading the drive to produce for users of MEF a new platform to share community knowledge. It has not sunk in what I got myself into until now.

I am very excited to be working with a great team of people to push MEF knowledge to a wider audience. I want to thank my teammates from the MEF development and documentation teams that will be working with me and Jeremy Likness to get this vision to become a reality.

 

 

So what will we be creating for the MEF Contrib Codeplex site? In the end we will have a wider variety of documentation that people can not only read and learn from but can contribute right away with their own knowledge and insights. here is what we will be bringing to the MEF community:

MEF documentation

We will be taking the documentation from the current MEF Codeplex site and moving it to the MEF Contrib site for further enhancements. Over the next few months our team will be updating the documentation and will release it to the community. We will be taking snapshots of the work and releasing betas of the documents for community review.

Knowledge Base

The Doc Team will be gathering all MEF blog posts, articles, video tutorials, screencasts and other online content and organizing a Knowledge Base for people to look through and learn from. We will be setting up some type of way to accept new content to include in the Knowledge Base. This area is still be defined and more information will come when we have a tight vision.

Quickstarts

One of the best ways for developers to learn not only MEF but any new development tool or library is to just do it. We on the Doc Team could not agree more and will be creating a set of Quickstarts for people to learn MEF from a beginner level knowledge to more advanced topics. These will be in the form of a document that walks a developer through the demo and the start and finish source for the demo project.

If you have ideas on what you would like to see from our Quickstarts please contact myself or Jeremy Likness.

Glossary/Vocabulary

An area I like to learn for any new technology is the vocabulary the community speaks when working and discussing with others using the tools/libraries. For people like myself we will also create a list of terms used in developing applications with MEF, a definition for the term along with a link to other places in the Documentation Project to see more details.

FAQ

Finally we will be creating a FAQ to answer the questions that the MEF team are frequently asked around why they created MEF and what problems they see it solving.

 

We are hoping in the next week to begin getting further details to our madness for the MEF Contrib Documentation Project out to the community. I really appreciate the support of Glenn and the entire MEF product team at Microsoft along with Andreas Håkansson who I have spoken to every evening.

The WCF RIA Services Issue I am trying to solve currently: Entity Framework 4 with Composite Associations

I have a baseball statistics database that contains composite primary and foreign keys throughout the schema. Here is an example and partial schema from the database:

clip_image001

I am trying to build a RIA Services application that shows views of the data from this portion of the database schema and a few other angles from the database. I am running into a few issues involving from the composite keys in the tables associated with the Player table.

First Entity Framework 4 does not create all of the Associations in the EDM and gives numerous warnings

The relationship ‘FK_Batting_Teams’ uses the set of foreign keys ‘{yearID, lgID, teamID}’ that are partially contained in the set of primary keys ‘{playerID, yearID, stint}’ of the table ‘Batting’.  The set of foreign keys must be fully contained in the set of primary keys, or fully not contained in the set of primary keys to be mapped to a model.                c:\users\cwoodruff\documents\visual studio 2010\Projects\BusinessApplication1\BusinessApplication1.Web\Model.edmx

These warnings can be resolved by removing the warnings from the EDM and creating the Associations by hand (that was an earlier email and thanks to Danny Simmons).

I added the following to the metadata on the server side. You show the composite key in the association through the Association annotation.

[Include]
[Association("FK_Batting_Player", "playerID", "playerID, yearID, stint")]
public EntityCollection<Batting> Battings;

I also added the following changes to the DomainService get method regarding the Player Entities for the required loading of the associated entity data.

public IQueryable<Player> GetPlayers()
{
    return this.ObjectContext.Players
        .Include("Battings")
        .Include("Pitchings")
        .Include("Fieldings")
        .OrderBy(p => p.nameLast);
}

With no change to the client side. I still am not getting any associated data when looking at the WCF Binary via Fiddler. I am just curious if the client side needs to reflect this same Association in the generated code?

Looking at the generated code in the Silverlight project you will see the following method on the client side for the Player Entity class. My question is about the Association annotation. Should the generated Association not also include the entire composite key from the Entity Framework Entity Data Model?

[Association("Player_Batting", "playerid", "playerID")]
[XmlIgnore()]
public EntityCollection<Batting> Battings
{
    get
    {
        if ((this._battings == null))
        {
            this._battings = new EntityCollection<Batting>(this, "Battings", this.FilterBattings, this.AttachBattings, this.DetachBattings);
        }
        return this._battings;
    }
}

So this is my issue I have been asking others inside and out the RIA Services product team. I am interested in what the solution is and if it is a bug in the WCF RIA Services product will ir be fixed soon?

Deep Fried Bytes Episode 42: How to Get More Business from Microsoft Pinpoint

http://deepfriedbytes.com/podcast/episode-42-how-to-get-more-business-from-microsoft-pinpoint/

A great talk with 2 members of the Microsoft Pinpoint team. Keith and I also chatted about the recently quiet period for Deep Fried Bytes and where we are going from here.

About Microsoft Pinpoint

Pinpoint is the fast, easy way for business customers to find experts, applications, and professional services to meet their specific business needs—and build on the software they already have.

At the same time, Pinpoint helps developers and technology service providers quickly and easily get software applications and professional services to market—and engage customers who need what they offer.

Pinpoint is the largest directory of qualified IT companies and their software solutions built on Microsoft technologies.
  • More than 7,000 software application offerings.
  • More than 30,000 Microsoft-technology experts.
  • The largest, most diverse set of Microsoft business platform offerings in the industry in a central location.
  • Direct links between applications and the services that support them.

What do I have in store and hope for 2010

Already almost a month into 2010 (where does the time fly?) so I thought I would get out my hopes and wants from this new year. After the crazy bi-polar year that was 2009, I really want 2010 to have much more stability. As this is the cornerstone hope I also add the following:

  • Take the podcast Deep Fried Bytes I do with Keith Elder to the next level. It has been a great almost 2 years since 2 guys started down this path. We have a great base and I just want to grow it and have more fun with it.
  • Learn 2 new development languages this year to expend my skills and knowledge. The first is Ruby. After hearing so many great things from everywhere I thought it would be time to learn what the fuss was all about. See that I have 2 great community leader in Joe O’Brien and Leon Gersing around, the learning should be fun through the Ruby Koans. The second and more mind blowing language is F#. I also have a great mentor in Chris Smith to assist me in the mastery of not only F# but with Functional Programming.
  • Master the art of web development with ASP.NET MVC 2, JQuery and also CSS. A daunting task which I hope to be up for as a huge challenge.
  • Live up to the MVP award Microsoft has given me and outreach to show the world the secrets of products such as Entity Framework and MSSQL Modeling Services. Will be a fun year with many new technologies and exposing the community these great emerging tools.
  • Lose 40 pounds and be at 235 lb for the summer. That will be the toughest task to keep.
  • The most important work I have in 2010 is as a Father and Husband. Nothing previously mentioned could be done without the support and sacrifice of my family. If 2009 taught me nothing it showed me that family and faith should be the top priorities in anyone’s life.
Powered by WordPress | Designed by: Email Search

Page optimized by WP Minify WordPress Plugin