Service Wizard should create BindingList CRUD methods

4 posts, 0 answers
  1. Jörgen
    Jörgen avatar
    10 posts
    Member since:
    Apr 2013

    Posted 18 Apr 2013 Link to this post

    I have a N-tier appilcation that uses DataAccess ORM and a WCF Plain service (created by DataAccess ORM)
    The WCF Service exposes a Read<tablename>s method that returns an Array of dto objects.
    I want to databind against a grid Control and then I cannot use an Array. I should use a BindingList for things to work properly.

    The WCF Plain serivce that is created by DataAccess ORM service wizard should have an option to create methods that uses BindingList
    instead of arrays in CRUD methods.
  2. Jörgen
    Jörgen avatar
    10 posts
    Member since:
    Apr 2013

    Posted 18 Apr 2013 Link to this post

    As is today I have to write code in my Windows Form that converts the Array to a BindingList Before I can databind to my grid Control.
    When I want to save I have to convert the BindingList back to an Array.
  3. DevCraft banner
  4. Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 19 Apr 2013 Link to this post

    Hi Jörgen,

    You can have the desired behaviour already by tweaking a configuration in the Add Service Reference dialog. Currently Add OpenAccess Service wizard generates only server side code and the code that you are referring sounds like client side and it is handled by different wizard.

    Using Add Service Reference dialog in Visual Studio you can set how to interpret the IEnumerable<T> return type. To do so please:
    1. Open Add Service Reference dialog
    2. Discover and select the hosted service
    3. Click on Advanced... button
    4. Change the value of the combobox under Data Type, Collection Type to the desired type. You can do the same for Dictionary types too
    5. Then apply the configuration by clicking OK
    6. Generate the client side code by clicking OK on the Add Service Reference dialog.

    This should enable you to use BindingLists in your client code without any overhead.

    Regards,
    Viktor Zhivkov
    the Telerik team
    Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
  5. Jörgen
    Jörgen avatar
    10 posts
    Member since:
    Apr 2013

    Posted 19 Apr 2013 Link to this post

    Correct. I've found it and changed the configuration of my WCF service it now works as I want. Problem Solved.
Back to Top