Scalar-Valued Functions Not Mapping

6 posts, 0 answers
  1. Systems
    Systems avatar
    5 posts
    Member since:
    Jun 2012

    Posted 17 Dec 2012 Link to this post

    Good Morning,

    In my model schema explorer I can see all the database sp's and udf's created. I can map them to a method and determine the return type. However one set of functions is not showing and that is the scalar-valued functions. I have tried several times to add them via the Update from Database wizard but they do not show in there? Articles like this (http://www.telerik.com/help/openaccess-orm/openaccess-tasks-model-tools-update-data-model-db-changes.html) and this (http://www.telerik.com/help/openaccess-orm/developer-guide-crud-sp-support-domain-method-db-functions.html) lead me to believe they should be added like any other function?

    TIA
    JB
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 18 Dec 2012 Link to this post

    Hello,

    The OpenAccess ORM schema reader does not retrieve information for the built-in database functions like SUM, MAX, etc. Only the user-defined scalar and table-valued functions are being fetched during the schema reading process.

    Nevertheless you could use these functions by using the following approach:

    Hope that helps. If any other questions arise, do not hesitate to contact us back.

    All the best,
    Damyan Bogoev
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  3. DevCraft banner
  4. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 18 Dec 2012 Link to this post

    Hello,

    Please find the code snippet attached:

    [MappedFunction(Name = "UPPER", IsDeterministic = false, Backend = Telerik.OpenAccess.Metadata.Backend.MsSql)]
    public static string ToUpper(string arg)
    {
        throw new NotImplementedException();
    }

    Greetings,
    Damyan Bogoev
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  5. Systems
    Systems avatar
    5 posts
    Member since:
    Jun 2012

    Posted 18 Dec 2012 Link to this post

    Yes I understand and that's what I'm talking about. My custom scalar valued function is NOT showing in the schema reader. Screen Shot of functions from SSMS.  Screen shot of OpenAxs schema wizard.

  6. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 20 Dec 2012 Link to this post

    Hello,

    I am afraid I was unable to reproduce the wrong behavior on my side. The user-defined scalar-valued functions are being obtained during schema reading.

    Could you please verify that the user, you are using during the schema reading session, has rights for reading these database objects? Additionally, I have to ask you to provide us with a database backup or ddl script in order to investigate the cause for the issue further?

    I am looking forward to hearing from you.

    Kind regards,
    Damyan Bogoev
    the Telerik team
    Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
  7. Systems
    Systems avatar
    5 posts
    Member since:
    Jun 2012

    Posted 20 Dec 2012 Link to this post

    Well don't I feel like an idiot. I thought that account did have perms. but never checked. You were right. Simply add the perms. and away we go. Sorry for the trouble.
Back to Top
DevCraft banner