Base solution for your next web application

Activities of "dougmorato"

We have licensed copy of Aspnetzero.

Downloaded 2018 May .First Week.

Hi,

I am using powertool to generate entities. Working as expected.

Need some help ...

Entity Order -created using powertool - Tenant Option No HOST

Entity Products - created using powertool. Tenant Option No HOST

Case 1:

I am adding a new Menu item "Details" inside the action dropdown of Order page as "Product Details" for accessing products page.

"View", "Edit" are good. No issues.

On Typescript , using router , i am transferring to products page , after user selects the "Details" menu option.

Now the problem is , if i select my newly added menu "ViewDetail", it is always going to "GetNotifications - Http call and show the notification page.

MY Router config is good , no chrome debugger errors.

Need some suggestions to implement this , multiple attempts failed on this scenario.

Need code sample for case 1:

Case 2:

For "Delete" option in Action dropdown, i would like to delete the record permanently on Database, what settings do i have to do to fix this. (Instead of soft delete). I need to refresh my grid based on the delete option. I am getting "Deleted successfully Message". ut DB retains data. Need code sample on case 2:

i agree.

but can u post a full sample code , where to modify the options
on both cases.

Thanks

<cite>ismcagdas: </cite> For Case 1:

Is your target page requires a permission ? This seems like a permission problem.

Yes,

** as i said , all pages are generated using ASPNETZERO , "Create an Entity "menu options.

Both my pages requires permission , permission.isGranted('Pages.modulename.Edit') , permission.isGranted('Pages.modulename.Delete') auto generated by the power tool.

Can u simulate a simple app from u r end and check , how to handle this scenario.

Thanks.

i believe , admin-routing has "App level artifacts " , all my entity/domain routing on my main.module .

From framework , u can easily generate my scxenario. could u please check to generate a sample and check and share the code.

Or template.txt has only Edit Delete and View options. do we need to modify the template for adding "ViewDetail" , just curios ??

<li> <a (click)="showProducts(record.app.id)">{{l(ViewDetail)}}</a> </li>

** generated by RAD tool.(main.module.ts)

Side panel, i have my Products Menu , which works fine. I am using the same path inside Order like ,

{{ path: 'ProductsApp/Products', component: ProductsComponent, data: { permission: 'Pages.Products' }}

using this path , typescript using

showProducts(){ router redirect ('ProductsApp/Products')

}

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
  • v 9.10
  • What is your product type (Angular or MVC)?
  • Angular
  • What is product framework type (.net framework or .net core)?
  • .Net Core

We have just downloaded one demo project and trying to develop a multi tanent sas application using Azure Sql as databse. Is is possible to have seperate databse for each tenant in Azure? Do you have any documentation for the same?

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
  • v9.10
  • What is your product type (Angular or MVC)?
  • angular
  • What is product framework type (.net framework or .net core)?
  • ,net core

I have generated multiple screens using the Visual Studio Extension Aspnetzero power tool. But suddenly it stopped working.

I have uninstalled and installed the RAD tool. I have recreated my code repo. But it not at all working. After creating generate button it closes automatically after few seconds.

Please guide us to troubleshoot and fix this issue.

We have just started developing a new product using ASPNetZero 9.1 Angular version. But I have doubts regarding the CRUD operation of entities with multiple parent-child relations. We have a “Parent” entity that contains a collection of “Child” entities. The “Child” table has the foreign key of parent ID. Now When deleting one “Parent”, I want to delete all the associated children. I don’t want to enable cascade delete at the DB level. To achieve this first I have deleted all the children and removed the parent. Please the pseudo-code below

Is it the optimal way to achieve this requirement? Actually, I am concern about the performance impact of calling child repository within the loop, there many huge numbers of children.

`[AbpAuthorize(AppPermissions.PagesParentDelete)] public async Task Delete(EntityDto input) { var parent = await parentRepository.GetAllIncluding(v => v.Children) .FirstOrDefaultAsync(v => v.Id == (int)input.Id); foreach (var child in parent.Children) { await childRepository.DeleteAsync(child.Id); } await _parentRepository.DeleteAsync(input.Id); }`

We have just started developing a new product using ASPNetZero 9.1 Angular version. But I have doubts regarding the CRUD operation of entities with multiple parent-child relations.

We have a “Parent” entity that contains a collection of “Child” entities. The “Child” table has the foreign key of parent ID.

Now as per the requirement when updating parent user update/delete any existing child or add a new child.

By following the Tutorial, I have tried with the below code. But it is throwing error “Child cannot be tracked because another instance with the same key value for {'Id'}”

<br>

protected virtual async Task Update(CreateOrEditParentDto input)
{
var parent = await _parentRepository.GetAllIncluding(v => v.children)
.FirstOrDefaultAsync(v => v.Id == (int)input.Id);
ObjectMapper.Map(input, parent);
}

<br> I have tried insert, delete children within for loop. But that is also throwing error.  I have found multiple links similar kind of issue but none of the solutions able to fix this issue.

What is the best way to add/update/delete all child entities with the same transaction?  A similar code works perfectly for the insert.

Please find the sample code below.

`public class CreateOrEditParentDto : EntityDto&lt;int?&gt; { 		
[Required] 		public string ParentName { get; set; } 	
public ICollection&lt;CreateOrEditChildDto&gt; Children { get; set; } }`
 public class CreateOrEditChildDto : EntityDto<int?>
    {
		[Required]
		public string Email { get; set; }
		public string FirstName { get; set; }
		public string LastName { get; set; }
		public int ParentId { get; set; }
}

The core classes are like below

 [Table("Parent")]
    public class Parent : FullAuditedEntity , IMustHaveTenant
    {
		public int TenantId { get; set; }
		[Required]
		public virtual string ParentName { get; set; }
		public virtual ICollection<Child> Children { get; set; }
}
[Table("Child")]
    public class Child : FullAuditedEntity , IMustHaveTenant
    {
	   public int TenantId { get; set; }
		[Required]
		public virtual string Email { get; set; }		
		public virtual string FirstName { get; set; }		
		public virtual string LastName { get; set; }
		public virtual int ParentId { get; set; }	
         [ForeignKey("ParentId")]
		public Parent ParentFk { get; set; }
	}
Showing 1 to 10 of 16 entries