.net - Update function import not displaying in context file -


I am using EF4 and I have used POCO unit generator to build my own institutions. I have a stored procedure called UpdateAppection Station; I have only 2 parameters near it called ApplicationID and ApplicationStateID. It does not return anything, so I set the return type as none, I only want to update the application state ID, and nothing else. When I import my function for this stored procedure, I do not see it in my reference file under "Import Import". Why is it like this? Is it made in the second place? How would I like to call this method?

Edit:

Is there no one here who can lead me here? What I want to do is call this import function (which is not in context) like I do my other import functions in my repository class:

  Public Zero UpdateApplicationState (int applicationID) , Int ApplicationStateID) {context.UpdateApplicationState (applicationID, applicationStateID); }  

and I think:

  applicationRepository.UpdateApplicationState (id, newApplicationStateID);  

This is my stored procedure:

  Optional process [dbo]. [UpdateUpdateTitat] (@EplificationInt, Applementation State INT INT) BEGIN UPDATE [APPLICATION] SET ApplicationStateID = @ApplicationStateID WHERE applicationID = @ApplicationID; END  

thanks

The problem is that the template provided with The EF4 POCO function does not control imports, which do not return any returns. You can either set a scalar return type, or you can modify yourProject.Context.tt file to fix the problem.

Look in the file that starts with this file:

  area. ("Import Import");  

Then a little more you will see a code block like this:

  if (edmFunction.ReturnParameter == tap) {continue; } String returnTypeElement = code.Escape (ef.GetElementType (edmFunction.ReturnParameter.TypeUsage));  

You can change it with the following:

  string returnmentlaylement = ADM function Return parametro == empty? Zero: code.Escape (ef.GetElementType (edmFunction.ReturnParameter.TypeUsage));  

Then check the two uses of returnTypeElement in the next two rows. The first method is in definition:

  & lt; # = Accessibility. Format (edmFunction) # & gt; ObjectResult & lt; & Lt; # = ReturnTypeElement # & gt; & Gt;  

Replace with:

  & lt; # = Accessibility. ForMethod (edmFunction) # & gt; & Lt; # = ReturnTypeElement == Faucet? "Int": ("object result"; + return type aliment + "& gt;") # & gt;  

There are a few more lines in the next return statement:

  return base. Execute Function & lt; & Lt; # = Return Type Element # & gt; & Gt;  

Replace with:

  base of return. Extech function & lt; # = ReturnTypeElement == Faucet? "": ("& Lt;" + Return Type Element + "& gt;") # & gt;  

Now you should know that this function prepares the import methods properly, perhaps the EF4 team will lift it and make modifications for us in the next version.


Comments