Error in code generation and model saving

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
jeroent
Posts: 12
Joined: Tue 25 Nov 2008 13:41

Error in code generation and model saving

Post by jeroent » Wed 25 Nov 2009 11:31

Hi,
I use the new Entity designer 2.50.50 and the added functionality is at a glance very useful. And it works very well.

But a found out that after I had saved the model, closed the designer and opened it afterwards, some prosperities of relations where not saved. If a mark that that a navigation property should not be generated, it doesn’t generate the code (as expected). And the mapping files are also as expected

But if I open the model a second time the property is marked as to be generated. If I now generate the code and mapping files the following happens:

In the .csdl file the property is present (corresponding to the current state of the model) but in the generated code the property is not pressed (as was the case in the previous state)
This code does not run because code and mapping does not correspond with one and other
Note I have changed noting after I opened the model for the second time (except from regenerating the model)

Can you please fix this bug on a short notice?
Greetings Jeroen

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 26 Nov 2009 08:49

Thank you for the report, we have already reproduced the problem.
I will let you know as soon as it is fixed.

jeroent
Posts: 12
Joined: Tue 25 Nov 2008 13:41

Post by jeroent » Thu 10 Dec 2009 16:09

Hello Andrey,

Do you have any timeframe, when this problem in the entity designer is fixed? It would save me a lot of time when this available.

Greetings Jeroen

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 11 Dec 2009 13:34

We have fixed the problem. The fix will be available in the nearest build.
The build will be available this year.

jeroent
Posts: 12
Joined: Tue 25 Nov 2008 13:41

Post by jeroent » Tue 05 Jan 2010 13:34

I have just installed the newest version of the entity developer and the problem still exists
(I am now using version 2.50.55 of entity developer)

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 05 Jan 2010 16:18

I have made some tests with the latest 2.50.55 build and everything works as expected.
Could you please try to regenerate the model?

jeroent
Posts: 12
Joined: Tue 25 Nov 2008 13:41

Post by jeroent » Tue 12 Jan 2010 08:35

There are still 2 errors in the entity developer concerning navigation properties.
Below is a test project describing the problem
I have created the following test model

Code: Select all

Country 
Properties:
- Id
- stamp
- ISO code
- name
Navigation properties:
- Address (Generate = False)

Address
- Id
- Postalcode
- Street
- AddressType
- Number
- City
Navigation properties:
- Country (Generate = true)
I Generated the code (file per class) and mapping files ssdl csdl and msl. The code files are generated as expected, in the Address class is a navigation property to country, and in the country class there are no navigation properties. See code exaples below

Code: Select all

[global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="DataSourceModel1", Name="Address")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Address : global::System.Data.Objects.DataClasses.EntityObject
    {
        #region Factory Method
…
        #endregion

        #region Properties
		…
        #endregion

        #region Navigation Properties

        /// 
        /// There are no comments for Country in the schema.
        /// 
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("DataSourceModel1", "Country_Address", "Country")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Country Country
        {
            get
            {
                …
            }
            set
            {
                …
            }
        }

        /// 
        /// There are no comments for Country in the schema.
        /// 
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference CountryReference
        {
            get
            {
…
            }
            set
            {
                …
            }
        }

        #endregion
    }


    /// 
    /// There are no comments for DataSourceModel1.Country in the schema.
    /// 
    /// 
    /// Id
    /// 
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="DataSourceModel1", Name="Country")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Country : global::System.Data.Objects.DataClasses.EntityObject
    {
        #region Factory Method
		…
        #endregion

        #region Properties
		…    
        #endregion
    }
But in the de CSDL file exactly the opposite applies. There in the country class there is an address navigation property and there is no country navigation property in address.

Code: Select all


  
    
    
    
      
      
    
  
  
    
      
    
    
    
    
    
    
    
  
  
    
      
    
    
    
    
    
    
  
  
    
    
  

If you use this code you get a runtime error becourse the conceptual model does not match the code.
The second problem is if a save the model, close the entity Developer . And reopen the model , the setting that the Navigation property Addresses in country must not be generated is not set (Generate = true)

I am using
version 2.50.55

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 13 Jan 2010 13:11

Thank you for the report. We are investigating the situation.
I will let you know about the results.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 29 Jan 2010 14:59

We have fixed the problem. Look forward to the nearest build.

Post Reply