This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Guys,
I've got a weird problem that I can't seem to figure out: I create a model with a User entity. Add two properties "Name" & "Surname". Then I decide to add a partial class so right click refactor the designer then create a partial class for me. Now I add my new property [This is for testing purposes]. "Age" Next step go to the Data->Add New Data Source select object select the User object complete the wizard. Now my property that I've added in the partial class does not appear.
I've tried it in VS2008 & VS2010 same issue. Weird part is if I create a new class in the model folder e.g. Person, Properties "Name" & "Surname" then I create a Person partial class in the custom folder follow the same steps as above add the data source the partial class properties are displayed in the Data Sources window. Next step to test was to remove the existing Person class and create the Person entity in the designer. Once created in the designer, (I didn't remove the partial class in the custom folder) all the extra property in the partial class still shows up in the Data Sources window. Next step remove the partial class and create a new one. Once I've removed the partial class recompiled and the property didn't show up as expected. Now I've added the partial class back again and the property is again displayed in the Data Sources window. Question is why does this happen? I've included my repo project. Any help would be greatly appreciated
Johan |
|
|
This sounds like it may be an issue where Visual Studio's code model is not keeping up with the partials. Because the Data Sources window can't rely on the project having been compiled, it's working out what to display from Visual Studio's view of the source code, rather than from a proper assembly. So it may be that there's a glitch in the FileCodeModel engine and/or the Data Sources window that means it's not picking up the partial class when it's first defined. My guess would be that a clean-and-rebuild should take care of that, but it might also require closing and reopening the solution. Unfortunately, this is probably outside our control. We're not doing anything weird or special, we're just generating C# and Visual Basic code, and whatever Visual Studio is doing to merge partial classes and populate the Data Sources window is independent of what we're doing. It sounds from your final comments as though the property is now displaying correctly, but with the various configurations you describe I think I may have lost track of whether the partial classes are defined as you want them to be. Do you currently have it working, or is there still a problem? |
|
|
Hi Ivan, Yes i'm still have the problem but don't worry i've found away around it. Just use an existing binding and then change the last bit to my "hidden" property and everything seems to work. Sorry to bother you with this issue.
Johan |
|
|
Hi Ivan, Just to give you some feedback I logged a bug with Microsoft Connect and they found that it was the partial class that was not set to compile and that's why the properties did not show up.
Johan |
|