×

Notice

The forum is in read only mode.
×
Getting new Releases

To get notified on new releases you may follow us on twitter @expandframework or subscribe in our main RSS feed.

Topic-icon Why does my generated code for class in World Creator looks like this?

  • jyoung3456
  • jyoung3456's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
6 months 3 weeks ago #11658 by jyoung3456
This is what WorldCreator Generates for class.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
using Xpand.Persistent.Base.PersistentMetaData;
using Xpand.Persistent.BaseImpl.PersistentMetaData.PersistentAttributeInfos;
using System.Linq;
usingAddress:Xpand.Persistent.Base.XpandBaseCustomObject{
public HousingAddress(Session session):base(session){}
public override void AfterConstruction() {
base.AfterConstruction();
[assembly: System.Reflection.AssemblyVersionAttribute("17.2.71.19")]
namespace House2{public class DynamicHouse2Module:DevExpress.ExpressApp.ModuleBase{}}
namespace House2{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
using Xpand.Persistent.Base.PersistentMetaData;
using Xpand.Persistent.BaseImpl.PersistentMetaData.PersistentAttributeInfos;

using System.Linq;


public class HousingAddress:Xpand.Persistent.Base.XpandBaseCustomObject{
public HousingAddress(Session session):base(session){}
public override void AfterConstruction() {
base.AfterConstruction();
}

protected override void OnSaving() {
base.OnSaving();
}

protected override void OnChanged(string propertyName, object oldValue, object newValue) {
base.OnChanged(propertyName,oldValue, newValue);
}

}
}

I have this template

namespace $ASSEMBLYNAME${
using System;
using System.Collections.Generic;
using System.ComponentModel;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
using Xpand.Persistent.Base.PersistentMetaData;
using Xpand.Persistent.BaseImpl.PersistentMetaData.PersistentAttributeInfos;

using System.Linq;

$TYPEATTRIBUTES$
public class $CLASSNAME$:$BASECLASSNAME${
public $CLASSNAME$(Session session):base(session){}
public override void AfterConstruction() {
base.AfterConstruction();
}

protected override void OnSaving() {
base.OnSaving();
}

protected override void OnChanged(string propertyName, object oldValue, object newValue) {
base.OnChanged(propertyName,oldValue, newValue);
}
$INJECTCODE$
}
}

Also, if I do not see XPObject when I try to bind to a type. Any way someone can let me know how to make it so I can see it?

Thanks,

J
The following user(s) said Thank You: SetkanaoknoSwilm
More
6 months 3 weeks ago #11659 by Tolis
for your first question please provide step by step instructions on how you generated the code? did you modified any template and with what values.

fyi in the sources Demos/Modules/WorldCreatorTester folder there is a solution which contains several EasyTests for WC which they worke fine.

for your 2nd question, you can bind any type that is listed in your Application/BOModel model node

To get notified on new releases follow us on twitter @expandframework or subscribe RSS feed. I am also available @tolisss . Also see How to debug eXpand
  • jyoung3456
  • jyoung3456's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
6 months 2 weeks ago #11668 by jyoung3456
Hi Tolis,

I was able to identify the issue. I got it "fixed" temporarily on my end by not using one of the functions that uses regex pattern. See attached screenshot. After I stopped using that function it started to work as expected.

I got another issue though that I want your input on. It's a different issue to this so I'll create another ticket.

Thanks,

J.

PS.: sorry I did not reply right away I got sick there for a bit so was away from my PC for a while.
Attachments:
More
6 months 2 weeks ago #11671 by Tolis
Hi J,

I happy to help as long as I understand how ti repro the issues and as I already answered you the EasyTested/common way to create a new PersistentAssembly works fine, so looking forward for your detailed instructions.

To get notified on new releases follow us on twitter @expandframework or subscribe RSS feed. I am also available @tolisss . Also see How to debug eXpand
  • jyoung3456
  • jyoung3456's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
6 months 1 week ago #11680 by jyoung3456
Hi Tolis,
The way I was able to do it, and I do not know if you can reproduce it in your new releases, but it was very simple setup.
I used 17.2.7.1 version of eXpand.
In my DevExpress’ solution in the Solution.Win project I went into WinApplication.cs file and added following references on top.
using Xpand.ExpressApp.WorldCreator.System;
using Xpand.ExpressApp.WorldCreator;
using Xpand.ExpressApp.WorldCreator.Win;
using Xpand.ExpressApp.WorldCreator.DBMapper;
I declared these variables.
private WorldCreatorModule _worldModule = null;
private WorldCreatorDBMapperModule _dbMapperModule = null;
private WorldCreatorWinModule _worldWinModule = null;

In the constructor of the WinApplication I added this call.
InitializeExpandModulesWin();
Then I added this function.
private void InitializeExpandModulesWin()
{
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
var _module1 = this.Modules.FindModule(typeof(Xpand.ExpressApp.ImportWizard.ImportWizardModule));
if (_module1 == null)
{
_importWizardModule1 = new Xpand.ExpressApp.ImportWizard.ImportWizardModule();
this.Modules.Add(_importWizardModule1);
}

var _module2 = this.Modules.FindModule(typeof(Xpand.ExpressApp.ImportWizard.Win.ImportWizardWindowsFormsModule));
if (_module2 == null)
{
_importWizardWinForms1 = new Xpand.ExpressApp.ImportWizard.Win.ImportWizardWindowsFormsModule();
this.Modules.Add(_importWizardWinForms1);
}

var _module3 = this.Modules.FindModule(typeof(Xpand.ExpressApp.ExcelImporter.ExcelImporterModule));
if (_module3 == null)
{
_excelImporterModule1 = new Xpand.ExpressApp.ExcelImporter.ExcelImporterModule();
this.Modules.Add(_excelImporterModule1);
}

var _module4 = this.Modules.FindModule(typeof(Xpand.ExpressApp.ExcelImporter.Win.ExcelImporterWinModule));
if (_module4 == null)
{
_excelImporterWinModule1 = new Xpand.ExpressApp.ExcelImporter.Win.ExcelImporterWinModule();
this.Modules.Add(_excelImporterWinModule1);
}

((System.ComponentModel.ISupportInitialize)(this)).EndInit();


}
I pretty much re-compiled my XAF solution and ran the project. Important the World creator was not hooked up as source for my project instead I’ve used pre-compiled DLLs from the distribution on the eXapnd site.
Once you do this and it works and you compile everything fine. Try going into Persistent Assembly screen and manually create long name persistent assembly something like OttawaHousingCorporation. After you do try also creating properties that have long names. The key here is to use long names for properties, namespaces, classes, etc. Eventually you’ll see what I saw.
Hope this helps you to replicate.
J.
More
6 months 1 week ago #11686 by Tolis
thnks for the details, I managed to repro it and I will provide a fix in the next minor 18.1.3.2

To get notified on new releases follow us on twitter @expandframework or subscribe RSS feed. I am also available @tolisss . Also see How to debug eXpand
Moderators: expand
Time to create page: 0.376 seconds