What is the difference between SqlFunctions and EntityFunctions?

前端 未结 4 1987
暗喜
暗喜 2020-12-05 14:21

What\'s the difference ? Are both used to perform functions in sql side before get data and store them in memory ?

P.S:
Both used in linq to ent

4条回答
  •  佛祖请我去吃肉
    2020-12-05 15:18

    SqlFunctions is a static class introduced in EF4 and is in assembly System.Data.Entity. It contains a long list of methods like Cos, DateAdd, DateDiff, DatePart, GetDate, Exp, Sign, which are mapped to SQL Server functions. These static functions can be called in LINQ to Entities queries.

    enter image description here

    EF4 also introduced the static EntityFunctions class. This class exposes conceptual model canonical functions which can be used in LINQ to Entities queries. These functions are mapped to the functions in the System.Data.Metadata.Edm namespace and they are only available in the conceptual model.

    enter image description here

    For more information click here

提交回复
热议问题