Base solution for your next web application

Activities of "maberry"

I know I am late to the party here, but I havent been able to locate a tutorial / post showing how to implement the wizard with aspnetzero. Can someone provide a link to where these documents were published?

Do you have any insight? I shared the code with you five days ago.

Hi @maberry

Is it possible to share your project's source code with [email protected] ? It would be better for us to help you on your source code with this issue.

Thanks,

Yes of course. You should have a github invite pending. I will followup with an email to [email protected] as well.

Hi @maberry

Sorry, then I misunderstand your question. In that case, you need to define onChange event (see https://primeng.org/dropdown#api.events) of each dropdown and then fill the following dropdown accordingly.

You can take a look at this sample https://stackblitz.com/edit/cascading-dropdown-angular?file=app%2Fapp.component.ts

Respectfully, can you please read my original post. The link you provided is the exact same link I referrenced. I then provided several statements as to why the code in that link does not match up with aspnetzero. What I need to know is how to implement the code from the link I provided within the aspnetzero framework. I have spent days trying different things within the code structure, but they have not worked. I am new to Angular, but I even asked someone who has worked with Angular for several years. He was unable to quickly figure it out because of how the aspnetzero code is structured.

Hi @maberry

  • When compared to ABP Suite, generated code in OnModelCreating works as designed. ABP Suite and also ABP Framework has a different approach here, that's why its generated code is different.
  • Duplicate of City entity in OnModelCreating is not what we expect. Could you share steps to reproduce this problem ?
  • Making modification on generated entities to move some fields to separate tables (like creating a City table instead of City field in Location entity) shouldn't be done using Power Tools. Power Tools is designed to be used mostly for first time usage. You can ofcourse make modifications for adding primary (text, int etc...) fields to existing entities. However, for moving a field to a new table, it would be better to make changes on the generated entity using Visual Studio.
  • I completely understand the approaches are different, but doesnt really answer the question of why Power Tools does not generate code OnModelCreating. ABP Suite is not the only code generator that puts more information in OnModelCreating. Not doing so causing all kinds of warnings in Visual Studio for null referrences, etc when building a project. Your answer indicates that it is working as expected. My question again - are you able to provide rationale for this behavior considering it causes errors and goes against convention?

  • Steps to reproduce duplication of entities in OnModelCreating - This happens EVERY time I regenerate an entity using Power Tools. That is the only step.

  • Am I understanding correctly that an appropriate use of Power Tools would be to regenerate entities for the purpose of adding fields, relationships, etc; however, removing fields, relationships, etc is not an appropriate use of the entension? If that is the case, it would seem like that information should most certainly be included in the documentation. I can not be the only person who wasted hours attempting to fix broken code after trying to remove a field. Just a thought.

Hi @maberry

Sorry for our late reply. AspNet Zero Power Tools generates the pages in a specific way. The scenario you are trying to develop is something totally different. Converting Power Tools generated source code to Metronic wizard is not something we can provide support for.

However, you can develop this page from scratch and I think it will be easier. To learn basics of ASP.NET Zero's Angular version, I suggest you to first follow https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Developing-Step-By-Step-Angular-Introduction if you haven't.

Then, you can use correct servies for filling dropdowns. I hope this helps you to get started with AspNet Zero.

I am not asking for asking for assistance converting Power Tools generated source code to the Metronic wizard layout.

What I need to know is how to implement a cascading dropdown list within the aspnetzero framework. The "typical" way of doing it will not work because of how the aspnetzero code is structured.

I am not sure why you offerred the link you did. It does not appear to offer a cascading dropdown list. Furthermore, I have search all of the sample applications I can find using both aspnetzero and ABP. Several people have asked the same question over the years (such as here: https://support.aspnetzero.com/QA/Questions/3292/Cascading-Dropdownlist). Unfortunately, the support representative sent the information via email rather than provide assistance through the forum.

I have noticed several things with Power Tools that seem counterproductive to the mission of aspnetzero. Can someone please let me know if the issues listed below are problems with the extension or is it working as designed? If the latter, can someone please provide rationale? If I understand the thought process, I may be able to work differently so these situations are not a hinderance to my workflow.

  1. Power Tools generates code for the OnModelCreating section of the DbContext; however, the generated code seems to be lacking a lot of context compared to other similar code generators. Below are snippets of the same entity using Power Tools and then one using the ABP Commercial code generator.

Generated from Power Tools modelBuilder.Entity<Customer>(c => { c.HasIndex(e => new { e.TenantId }); });

Generated from ABP Suite builder.Entity<Customer>(b => { b.ToTable(mergeConsts.DbTablePrefix + "Customer", mergeConsts.DbSchema); b.ConfigureByConvention(); b.Property(x => x.TenantId).HasColumnName(nameof(Customer.TenantId)); b.Property(x => x.FirstName).HasColumnName(nameof(Customer.FirstName)).HasMaxLength(CustomerConsts.FirstNameMaxLength); b.Property(x => x.LastName).HasColumnName(nameof(Customer.LastName)).HasMaxLength(CustomerConsts.LastNameMaxLength); b.Property(x => x.Phone).HasColumnName(nameof(Customer.Phone)).HasMaxLength(CustomerConsts.PhoneMaxLength); b.Property(x => x.Email).HasColumnName(nameof(Customer.Email)).HasMaxLength(CustomerConsts.EmailMaxLength); b.Property(x => x.Business).HasColumnName(nameof(Customer.Business)).HasMaxLength(CustomerConsts.BusinessMaxLength); b.Property(x => x.FullName).HasColumnName(nameof(Customer.FullName)).HasMaxLength(CustomerConsts.FullNameMaxLength); b.Property(x => x.ContactType).HasColumnName(nameof(Customer.ContactType)); b.HasMany(x => x.Locations).WithOne().HasForeignKey(x => x.CustomerId).IsRequired().OnDelete(DeleteBehavior.NoAction); });

  1. I often find code generated several times for the same entity in the OnModelCreating section of the DbContext. For example, say I use Power Tools to create two entities: City and State. Once both are created, I return to PowerTools via the Regenerate Entity tab and create navigational properties between City and State. Rather than update existing code, Power Tools generates another City entity within OnModelCreating. This happens every time I regenerate an entity. It does not seem to be causing any issues, but at least very least it is bloating my code.

  1. Can you please point me to a tutorial related to how I should modify entities without breaking my code. For example - I created an entity titled Location with properties for Street Address, City, State, and Zip code. Later I decided I wanted separate tables for City, State, and Zip Code. I returned to Power Tools via the Regenerate Entity tab and removed the properties for City, State, and Zip Code. Once completed, I rebuilt and refreshed with nswag, but the result was so many errors I had to scrap the application and resort to an earlier copy. I do not have screenshots to show because I deleted the files; however, it seemed as though Power Tools deleted the properties from the projectName.Core folder, but it did not delete anywhere else. I have had this happen several times, so I assume there is a specific way the extension wants me to do it.

Three days and no response from customer support. This does not bode well considering I just getting into aspnetzero. Good thing I am still within the 30 day window.

Can someone please provide assistance with configuring a dependent dropdown picklist for my application. Specs are as follows: Latest version of aspnetzero is being used.

Table 1: Customer Table 2: Location Table 3: Order Table 4; OrderLocation

Customer can have many locations. Therefore, the customer table uses a master-detail layout with Location (this is working fine). Both customer and location are set up as lookups in the OrderLocation table.

Orders can have only one customer but many locations, and the OrderLocation table provides tracking/status for each location in the order. Therefore, customer is a lookup field in the order table.

I want use one of the Metronic wizard layouts. When I create a new order, I want to be able to select the customer from the picklist. Then next screen will take me to the OrderLocation table where I want to select locations based only on the customer identified in the Order table.

I’ve seen several similar questions, but I haven’t seen anything similar enough for me to replicate. Mainly because I am new to aspnetzero and there is a learning curve with respect to the flow of data from database to angular. I am not the strongest with Angular, but I am using Angular because it appears to be “easier” to manipulate certain aspects within the DDD/aspnetzero framework.

Using this as a guide:

I have not made any modifications to the files generated by PowerTools within Visual Studio, so given the parameters above, I believe I need to change selectedCountry to _orderLocationServiceProxy,

The countries variable will need to be changed to order, and the states variable will need to be changed to location; however, I can not figure out the changes necessary for Country[] and State[] within the aspnetzero framework.

I assumed it would be something similar to _orderLocationServiceProxy.getAll(), but that does not work.

I know changes will also need to be made for the onSelect syntax as well, but I haven’t been able to try anything because I haven’t gotten the above working yet.

As previously indicated, I have searched the support forum here as well popular sites such as stackoverflow, but I have not been able to isolate my specific use case. Any assistance would be greatly appreciated.

Showing 11 to 19 of 19 entries