Closed JonathanHiggs closed 9 years ago
Patches welcome ;-)
Mostly there with:
from entity in metadata.GetItems<ComplexType>(DataSpace.OSpace)
from property in entity.Properties
where property.IsEnumType
select new EnumReference
{
ReferencingTable = GetTableName(metadata, GetEntity(metadata, entity)),
ReferencingField = String.Format("{0}_{1}", entity.Name, property.Name),
EnumType = objectItemCollection.GetClrType(property.EnumType)
}
It is just getting the ReferencingField name that I am not sure how to get. Any pointers?
I'll have a look when I get a chance, good work :-)
I've done what I can for now but have run out of spare time. I've left some notes in the branch's code on what to look into next; and you can see the test is still failing. Currently GetTableName is returning null for complex types so they are just ignored, so there's still no actual exception.
I have a branch https://github.com/timabell/ef-enum-to-lookup/tree/complex-types-take-2 that basically works if you haven't aliased any of the columns. I need to deal with issue #19 before I can include this in a release as I suspect aliases will be more common for complex types, and if people have a complex type that would previously have been ignored this would be a breaking change.
Released in 1.5.0-beta
. Please test this pre-release package and report any issues https://www.nuget.org/packages/ef-enum-to-lookup/1.5.0-beta
Thanks
Installing pre-release packages: http://blog.iwanek.eu/how-to-install-prerelease-nuget-package/
I have an enum on a complex type that isn't getting found