dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.78k stars 3.19k forks source link

Metadata: Schema mismatch in user defined function #9360

Closed smitpatel closed 7 years ago

smitpatel commented 7 years ago

https://github.com/aspnet/EntityFramework/blob/dev/src/EFCore.Relational/Metadata/Conventions/Internal/RelationalDbFunctionConvention.cs#L37

Above line sets schema for UDF to Model.DefaultSchema if it is not set on attribute & only when the DbFunction is added to the model.

Issues:

We need to pull the logic out of that convention which sets the schema to model's default schema.

divega commented 7 years ago

EF Triage: we should make it work the same way it works for tables.

pmiddleton commented 7 years ago

How does it work for tables? I was going to look at this tonight along with the updates for #9303

smitpatel commented 7 years ago

https://github.com/aspnet/EntityFramework/blob/dev/src/EFCore.Relational/Metadata/RelationalEntityTypeAnnotations.cs#L113

This is how it works for table. The getter of schema looks into model.

smitpatel commented 7 years ago

fixed via 7529563ec9136359a78a223f6e69441641a03924