Home > RIA > Do you know this about RIA service:

Do you know this about RIA service:

RIA services strictly follow Naming convention and signatures.Like Method that are meant to query and return data to the client should begin with one of the following prefixes:Get,Fetch,Query,Retrieve and Select.This methods should have return type as IEnumerable, IQueryable, or a single instance of the entity type.However, you can have any number of parameters in a query method, which can help you to filter the results. Below Table lists the various combinations of naming conventions that you can follow when you add your own CRUD operations, if you wish for them to be exposed by the WCF RIA Services framework.

Data method

Required Method Prefix

Required Method Signature

Query Data Get, Fetch, Query, Retrieve,

or Select

IEnumerable<T> GetData()

IQueryable<T> GetData()

Create Data Insert, Add, Create void InsertData(T entity)
Update Data Update, Change, Modify void UpdateData(T entity)
Delete Data Delete, Remove void DeleteData(T entity)

If, for some reason, you are unable to follow the WCF RIA Services naming conventions in your own custom methods, you also have the option of adding specific attributes above the method declarations.

The WCF RIA Services framework also looks for these attributes when determining which methods to make available to clients. You can use any of the following attributes above your custom methods: [Query], [Insert], [Update], and [Delete]. For example, if you have a method that searches for specific foods called FindExercises, by default, this method is not exposed to the client.

If you were to add the [Query] attribute directly above the method declaration then the framework would, in fact, expose it to clients.

Advertisements
Categories: RIA Tags:
  1. kaushal
    August 31, 2010 at 10:10 am

    nice entry nikunj, thanks for sharing.

  2. December 2, 2012 at 8:42 am

    Howdy! I know this is kinda off topic however , I’d figured I’d ask.
    Would you be interested in trading links or maybe guest authoring a blog article or
    vice-versa? My website covers a lot of the same topics as yours and I believe we could greatly benefit from
    each other. If you are interested feel free
    to shoot me an e-mail. I look forward to hearing from you!
    Fantastic blog by the way!

  3. January 23, 2013 at 8:11 pm

    What i don’t understood is if truth be told how you are no longer really much more well-favored than you might be now. You’re very intelligent.
    You recognize thus significantly with regards to this matter, produced me in my view believe it from so many various angles.
    Its like men and women aren’t interested except it is one thing to accomplish with Lady gaga! Your own stuffs great. At all times handle it up!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: