Function mapping in Entity framework

178 Views Asked by At

So, I am working on an already existing application. The application has implemented a DB first approach. I recently updated a stored procedure. I updated the same stored procedure in the EDMX file, using the model browser.

Lets call the SP as "GetData"

The SP is nothing but a set of select statements executed one after another.

Now, there was already an existing FunctionImport and a complex type for this particular SP.

The function import is not showing a return type for the SP. It looks like this Function Import Returns None

But, the modelContext.cs file autogenerated has a type present there, like this

        public virtual ObjectResult<EMPLOYEEDATA> sp_GetData(Nullable<int> isActive)
        {
        var isActiveParameter = isActive.HasValue ?
            new ObjectParameter("IsActive", isActive) :
            new ObjectParameter("IsActive", typeof(int));

        return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<EMPLOYEEDATA> 
          ("GetData", isActiveParameter);
       }

Entity EMPLOYEEDATA , where is that coming from.Clearly, the function import is not returning anything. Where is that getting set up? I checked the EDMX XML, the result mapping does show EMPLOYEEDATA present there. But, if I now want to add a couple of other mappings to be returned as well, how do I do it?

Where is this mapping happening? I dont see it in the model browser?

0

There are 0 best solutions below