Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical template for One-To-One & self references #31

Open
GeBoML opened this issue Jun 18, 2021 · 0 comments
Open

Hierarchical template for One-To-One & self references #31

GeBoML opened this issue Jun 18, 2021 · 0 comments

Comments

@GeBoML
Copy link

GeBoML commented Jun 18, 2021

Hi,
As a long time user of EntitySpaces 2012, I've just yesterday found out that there is a new version available since 2019/2020 and I was very pleased to see that such a good product was revived.
But I'm having a problem with the Hierarchical template for One-To-One relationships between 2 tables and for self referencing tables (as eg the parent of an item).
Upon compilation of the generated tables I get the CS0542 error: 'member names cannot be the same as their enclosing type'.
Upon examination, the property name for the referencing object is the same as the class name it is defined in (see resulting code below).

public partial class TblSitesSalesInfo : esTblSitesSalesInfo
{
	#region TblSitesSalesInfo - One To One (tblSitesSalesInfo_FK00)
		
	[EditorBrowsable(EditorBrowsableState.Never)]
	public bool ShouldSerializeTblSitesSalesInfo()
	{
		return (this._TblSitesSalesInfo != null) ? true : false;
	}

	[DataMember(Name="TblSitesSalesInfo", EmitDefaultValue = false)]
	public TblSites TblSitesSalesInfo
	{
		get
		{
			......

[In the class TblSiteSalesInfo it needs to create a reference to an object of type TblSites, but the property name is TblSiteSalesInfo instead of TblSites or the alias given in the MetaData]

I've already browsed through all open and closed issues, have given the foreign key relationship a different alias as suggested in issue #4 and tried correcting the Hierarchical template myself, but I've not found a solution for this.

Can anyone please help me?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant