Yes. You have to do it. With EF 6.1, it’s easier to create things in both the first and the first database.
codeplex Code first store functions, . nuget:
(, , ) Entity Framework 6.1.1+ Code First.
https://codefirstfunctions.codeplex.com/
, , SQL. readonly:
[DbFunction("MyContext", "CustomersByZipCode")]
public IQueryable<Customer> CustomersByZipCode(string zipCode)
{
var zipCodeParameter = zipCode != null ?
new ObjectParameter("ZipCode", zipCode) :
new ObjectParameter("ZipCode", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext
.CreateQuery<Customer>(
string.Format("[{0}].{1}", GetType().Name,
"[CustomersByZipCode](@ZipCode)"), zipCodeParameter);
}
EF 6, import, . , ( Visual Studio 2013), EDMX xml. :
http://logiczone.me/entity-framework-and-sql-db-scalar-functions