Hello,
In PropertyName the fields are not showed for EF structure. You can see in attached image.
Thanks,
Marco Castro
We have closed this ticket because another page addresses its subject:
Core - Design-time Model Editor does not take Entity Framework class metadata into accountHello,
In PropertyName the fields are not showed for EF structure. You can see in attached image.
Thanks,
Marco Castro
Starting with version 18.2.7, this issue can be addressed by creating a context initializer and attaching it to the context as described in the Core - Design-time Model Editor does not take Entity Framework class metadata into account ticket.
In version 14.1.3, the issue was fixed for certain scenarios.
In older versions, there was no built-in mechanism to propagate the required metadata information to designers like the Model Editor. However, after upgrading to version 13.1.6,you can overcome this issue (for certain scenarios) by adding a few lines of code to your project.
Model First:
Add the following static constructor into your platform-agnostic ModuleBase descendant (typically, in the YourSolutionName.Module/Module.xx file):
C#static YourSolutionNameModule() {
MetadataWorkspace metadataWorkspace = new MetadataWorkspace(YourMetadataString.Split('|'), new Assembly[] { typeof(YourObjectContext).Assembly });
EFTypeInfoSource efTypeInfoSource = new EFTypeInfoSource(XafTypesInfo.Instance, typeof(YourObjectContext), metadataWorkspace);
((TypesInfo)XafTypesInfo.Instance).AddEntityStore(efTypeInfoSource);
...
}
Take special note that YourMetadataString is a string like "res://*/BusinessObjects.MyDataModel.csdl|res://*/BusinessObjects.MyDataModel.ssdl|res://*/BusinessObjects.MyDataModel.msl" taken from the configuration file for your EF model, while YourObjectContext is your ObjectContext class descendant.
Code First:
Add the following static constructor into your platform-agnostic ModuleBase descendant (typically, in the YourSolutionName.Module/Module.xx file):
C#static YourSolutionNameModule() {
YourDbContext efDemoDbContext = new YourDbContext();
MetadataWorkspace metadataWorkspace = ((IObjectContextAdapter)efDemoDbContext).ObjectContext.MetadataWorkspace;
EFTypeInfoSource efTypeInfoSource = new EFTypeInfoSource(XafTypesInfo.Instance, typeof(YourDbContext), metadataWorkspace);
((TypesInfo)XafTypesInfo.Instance).AddEntityStore(efTypeInfoSource);
...
}
Add the following constructor to your DbContext class descendant:
C#public YourDbContext()
: base() {
Init();
}
.
@Kirsten: We will review this code with relation to the current version and update it as soon as we can.
With the version 18.2.6 we provided the capability to fix this issue on your side. Please refer to the Core - Design-time Model Editor does not take Entity Framework class metadata into account for more details.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Marco,
I could not replicate this problem in my tests with our EFDemo.
Take special note that by default our framework only shows public properties and not fields.
If this is OK, please tell us how to replicate this behavior locally.
Hi Dennis,
I'm talking about Visual Studio not the XAF Application.
Hello Marco,
I have just replicated this behavior, and it looks unexpected. We need some additional time to research this scenario (debug, consult with our R&D team and check related feature documentation) to see whether support for this scenario was planned when designing the product or added for this release. Your patience is highly appreciated.
I am afraid I cannot offer you good solutions in the meantime, except for using the runtime Model Editor.