EntityFramework.Functions library implements Entity Framework code first support for stored procedures (with single result type, multiple result types, output parameter), table-valued functions (returning entity type, complex type), scalar-valued functions (composable, non-composable), aggregate functions, built-in functions, niladic functions, and model defined functions.
Getting this exception: System.Data.Entity.Core.MetadataException: Schema specified is not valid. Errors:
(0,0) : error 0005: The 'Aggregate' attribute is not allowed.
(0,0) : error 0005: The 'BuiltIn' attribute is not allowed.
(0,0) : error 0005: The 'NiladicFunction' attribute is not allowed.
(0,0) : error 0005: The 'IsComposable' attribute is not allowed.
(0,0) : error 0005: The 'ParameterTypeSemantics' attribute is not allowed.
(0,0) : error 0005: The 'Schema' attribute is not allowed.
(0,0) : error 0005: The 'Mode' attribute is not allowed.
Here is the ModelDefinedFunction that I created and attached to the context:
public static class ModelDefinedFunctions { [ModelDefinedFunction(nameof(ParseDecimal), "Envoy.Infrastructure.Data.SqlServer.dbEnvoy", @"cast(svalue as Decimal(20,8))")] public static decimal ParseDecimal(this string svalue) => decimal.Parse(svalue); }
Getting this exception: System.Data.Entity.Core.MetadataException: Schema specified is not valid. Errors: (0,0) : error 0005: The 'Aggregate' attribute is not allowed. (0,0) : error 0005: The 'BuiltIn' attribute is not allowed. (0,0) : error 0005: The 'NiladicFunction' attribute is not allowed. (0,0) : error 0005: The 'IsComposable' attribute is not allowed. (0,0) : error 0005: The 'ParameterTypeSemantics' attribute is not allowed. (0,0) : error 0005: The 'Schema' attribute is not allowed. (0,0) : error 0005: The 'Mode' attribute is not allowed.
Here is the ModelDefinedFunction that I created and attached to the context:
public static class ModelDefinedFunctions { [ModelDefinedFunction(nameof(ParseDecimal), "Envoy.Infrastructure.Data.SqlServer.dbEnvoy", @"cast(svalue as Decimal(20,8))")] public static decimal ParseDecimal(this string svalue) => decimal.Parse(svalue); }