Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. CREATE FUNCTION [dbo].[CheckLocation]
  2. (
  3. @locationId Int
  4. )
  5. RETURNS bit
  6. AS
  7. BEGIN
  8. //code
  9. END
  10.  
  11. <Function Name="CheckLocation" ReturnType="bit" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" >
  12. <Parameter Name="locationId" Type="int" Mode="In" />
  13. </Function>
  14.  
  15. public partial class MainModelContainer
  16. {
  17. [EdmFunction("MainModel.Store", "CheckLocation")]
  18. public bool CheckLocation(int locationId)
  19. {
  20. throw new NotSupportedException("Direct calls not supported");
  21. }
  22. }
  23.  
  24. Context.CheckLocation(locationId);
  25.  
  26. var students = context.Locations
  27. .Select ( new { location= CheckLocation(locationId)}):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement