public static async Task <PropertySelectorViewModel> Create(Document doc, string dtoName, SolutionLocation dtoLocation, Document existingDto = null) { var autogeneratedProperties = await EntityParser.GetAutoGeneratedProperties(existingDto); var instance = new PropertySelectorViewModel(); instance.EntityModel = await EntityViewModel.CreateRecursive(doc, depth : 3, existingProperties : autogeneratedProperties, canReuseBaseMapper : true); instance.EntityModel.DtoName = dtoName; instance.DtoLocation = dtoLocation; var isDerived = await EntityParser.HasBaseDto(existingDto, instance.EntityModel.BaseEntityDtoName); instance.EntityModel.ReuseBaseEntityMapper |= isDerived; return(instance); }