Window Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 20 October 2008

Silverlight 2 Grid with Silverlight Enabled WCF Services

Posted on 19:32 by Unknown

With ref. to my previous post on Silverlight 2 Grid : LINQ to SQL + WebServices, I would like to just add this post as a patch to it [In our terms we call it “Service Pack” :) ]

Astoria I am working on it, so may be I will drop more light on that part around this weekend [Diwali festival preparation is on head]

Microsoft given a wonderful template as “Silverlight enabled WCF Service”, well extention is still svc as it was for WCF and it is for Astoria too [Entity Framework ADO.NET services] which comes with SP of Visual Studio 2008

See the pictures below :

SolutionExplorerforSLEnableWCF

From above fig. SLSrv.svc is our Silverlight enable WCF service, See the below diagram so that you will get idea how that is there :

SLEnableWCF

What I like most about Silverlight enable-WCF services is they are much more simple than WCF and they have unique flavor of old ASMX services, so you may not find an separate Interface –class file to implement the Operation Contracts, All goes in one file which is good thing from developers point of view, especially newbies often get confuse with WCF for their initial days of development.

So, rest all part is same like adding ref., creating proxy etc. code will look like follows :

namespace SLEnableWCF.Web
{
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class SLSrv
    {
        [OperationContract]
        public List<Cust> DBConnect()
        {
            MyDatabaseDataContext db = new MyDatabaseDataContext();
            var temp = from cust in db.Custs
                       where cust.CustName.Length > 0
                       select cust;
            return temp.ToList();
        }
        // Add more operations here and mark them with [OperationContract]
    }
}

This is how we can go ahead and add whatever no of Operation Contract here with their signature and implementation.

This makes life easy and again XAML.cs code will be as is like it was earlier, like to fire completed event and calling async() method.

I leave this part below without any explanation for my users, sort of excercise for them :

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

Well, if you feel that you want some more differences between this Silverlight enable service and other services, A good post is here :

http://silverlight.net/blogs/msnow/archive/2008/09/22/silverlight-tip-of-the-day-43-silverlight-enabled-wcf-services-versus-asmx-web-services.aspx

So, I hope now you will drop WCF weapons and pick up this new one, I will be back with tons of new things like Astoria,LINQ to XML and offcourse Silverlight !

Vikram.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • First Windows Phone 7 update February 2011 - Small update but Big start
    After tons of rumors and set of predictions on Windows Phone 7 all over Internet, Microsoft came up with first Windows Phone 7 minor update ...
  • The little Story of “I Unlock Joy” event by Microsoft and Pune User Group
      This post is about recent “I Unlock Joy” event happened in Pune which was conducted by Microsoft and Pune User Group. Little History : ...
  • DeepZoom with PhotoZoom and Silverlight.live.com
    I have already wrote article on How to build DeepZoom with DeepZoom Composer, I know after that another version of DeepZoom came up, but cha...
  • Lap around Report Builder 2.0
    Report Builder 2.0 is basically used for Designing the Reports which we incorporate in applications using SSRS [SQL Server Reporting Service...
  • Silverlight On Mobile : Windows Phone 7 Splash Screen and Customization
    After talking about 3D capabilities on Windows Phone 7 using Silverlight in last article , Now I am moving ahead with small but equally impo...
  • I am Silverlight MVP !!!
    I am happy to tell all my blog readers that I am now Microsoft Most Valuable Professional for “Silverlight” Technology for year 2009-2010. ...
  • Silverlight 2 : Theming from Silverlight 2 Toolkit
    It’s now time to put on some cool Themes to your Silverlight 2 Controls. I have already talked about Silverlight toolkit in my last post, ...
  • Silverlight On Mobile : Using EQATEC Profiler for your Windows Phone 7 Applications
    I hope you like my last article on Invoking WCF service in Windows Phone 7 Application, with that article we are soon moving to CRUD operati...
  • Silverlight 5 : Platform Invoke (PInvoke) in Silverlight
      Two days back Microsoft announced availability of Silverlight 5 RC,I encourage you to download bits from here , My friend Pete Brown alr...
  • Silverlight, HTML5 & Windows 8 : Where we are heading to ?
    This is not the post or yet another post on most happening debate of Silverlight and HTML5, This is just a visit to all of them to realize t...

Blog Archive

  • ►  2013 (4)
    • ►  August (1)
    • ►  April (3)
  • ►  2012 (4)
    • ►  July (1)
    • ►  March (2)
    • ►  January (1)
  • ►  2011 (24)
    • ►  December (1)
    • ►  September (4)
    • ►  August (2)
    • ►  July (1)
    • ►  June (4)
    • ►  May (3)
    • ►  April (3)
    • ►  March (1)
    • ►  February (4)
    • ►  January (1)
  • ►  2010 (21)
    • ►  December (1)
    • ►  November (2)
    • ►  October (3)
    • ►  September (2)
    • ►  August (4)
    • ►  July (5)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  January (1)
  • ►  2009 (49)
    • ►  December (1)
    • ►  November (5)
    • ►  October (2)
    • ►  September (1)
    • ►  August (5)
    • ►  July (5)
    • ►  June (1)
    • ►  May (5)
    • ►  April (5)
    • ►  March (9)
    • ►  February (4)
    • ►  January (6)
  • ▼  2008 (43)
    • ►  December (3)
    • ►  November (9)
    • ▼  October (7)
      • Silverlight 2 Charts : Building Charts using Silve...
      • Windows Azure : Getting Started with Cloud – Part 1
      • Silverlight 2 : Download Contents on Demand
      • Silverlight “Live” Streaming
      • Silverlight 2 Grid with Silverlight Enabled WCF Se...
      • Silverlight 2 Grid : LINQ to SQL + WebService
      • Silverlight : “Truth” more than “Myth”…
    • ►  September (4)
    • ►  August (2)
    • ►  July (3)
    • ►  June (4)
    • ►  May (3)
    • ►  March (3)
    • ►  February (5)
Powered by Blogger.

About Me

Unknown
View my complete profile