﻿using System;
using System.Threading.Tasks;
using Abp.AspNetCore.Mvc.Authorization;
using Microsoft.AspNetCore.Mvc;
using {{Namespace_Here}}.Web.Areas.{{App_Area_Name_Here}}.Models.{{Entity_Name_Plural_Here}};
using {{Namespace_Here}}.Web.Controllers;
using {{Namespace_Here}}.Authorization;
using {{Namespace_Here}}.{{Namespace_Relative_Full_Here}};
using {{Namespace_Here}}.{{Namespace_Relative_Full_Here}}.Dtos;
using Abp.Application.Services.Dto;
using Abp.Extensions;

namespace {{Namespace_Here}}.Web.Areas.{{App_Area_Name_Here}}.Controllers
{
    [Area("{{App_Area_Name_Here}}")]
    [AbpMvcAuthorize(AppPermissions.{{Permission_Name_Here}})]
    public class {{Master_Detail_Child_Prefix_Here}}{{Entity_Name_Plural_Here}}Controller : {{Project_Name_Here}}ControllerBase
    {
        private readonly I{{Entity_Name_Plural_Here}}AppService _{{entity_Name_Plural_Here}}AppService;

        public {{Master_Detail_Child_Prefix_Here}}{{Entity_Name_Plural_Here}}Controller(I{{Entity_Name_Plural_Here}}AppService {{entity_Name_Plural_Here}}AppService)
        {
            _{{entity_Name_Plural_Here}}AppService = {{entity_Name_Plural_Here}}AppService;
        }

        public ActionResult Index({{Master_Detail_Child_Base_Entity_Type_Here}} {{master_Detail_Child_Foreign_Property_Name_Here}})
        {
            var model = new {{Master_Detail_Child_Prefix_Here}}{{Entity_Name_Plural_Here}}ViewModel
			{
				FilterText = "",
				{{Master_Detail_Child_Foreign_Property_Name_Here}} = {{master_Detail_Child_Foreign_Property_Name_Here}}
			};

            return View(model);
        } 
       
{{Create_Or_Edit_Here}}
{{View_Method_Here}}

{{NP_Looped_Controller_Here}}
    }
}