Error in code generation and model saving
Error in code generation and model saving
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
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
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
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
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.
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
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)
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
}
Code: Select all
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