Method return type of a query from multiple tables

2 posts, 0 answers
  1. Camilo
    Camilo avatar
    4 posts
    Member since:
    Oct 2012

    Posted 18 Oct 2012 Link to this post

    Hello, how I can return a list of data when I extract information from multiple tables, I have a business layer which query data layer OppenAccess, the filing must obtain the list through the business layer, as would be the return an anonymous method without having to create a class that defines the return type. thanks
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 22 Oct 2012 Link to this post

    Hi Camilo,

    You could achieve this goal by using one of the following approaches:

    • Set the method’s return type to System.Object and later on cast the result of the method in caller;
    • Use a generic method;

    You cannot declare method return value to be an explicit type of anonymous types.

    Hope that helps.

    All the best,
    Damyan Bogoev
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  3. DevCraft banner
Back to Top