This is a migrated thread and some comments may be shown as answers.

Scalar-Valued Functions Not Mapping

5 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Systems
Top achievements
Rank 1
Systems asked on 17 Dec 2012, 06:26 PM
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

5 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 18 Dec 2012, 04:31 PM
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.
0
Damyan Bogoev
Telerik team
answered on 18 Dec 2012, 04:34 PM
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.
0
Systems
Top achievements
Rank 1
answered on 18 Dec 2012, 05:55 PM
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.

0
Damyan Bogoev
Telerik team
answered on 20 Dec 2012, 03:45 PM
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.
0
Systems
Top achievements
Rank 1
answered on 20 Dec 2012, 04:26 PM
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.
Tags
General Discussions
Asked by
Systems
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Systems
Top achievements
Rank 1
Share this question
or