Antaris / RazorEngine

Open source templating engine based on Microsoft's Razor parsing engine
http://antaris.github.io/RazorEngine
Other
2.14k stars 577 forks source link

How much time should a compile and run take on a small ~ 100kB HTML #472

Open hidegh opened 7 years ago

hidegh commented 7 years ago

I noticed that first compile takes about 3.5 sec. Then each other call still takes 0.3sec. 300ms is still too much!

I do use Compile / Run and (v3.9.3):

Got same behaviour (times) when I use RunCompile with a fixed key!

Also had an issue that a no template was found under the given template key, but after also added the model type to the Compile / Run calls, this was no more an issue...

My settings are:

            var templateConfigDebug = new TemplateServiceConfiguration()
            {
                Language = Language.CSharp,
                EncodedStringFactory = new HtmlEncodedStringFactory(),
                Namespaces = new HashSet<string>(namespaces),

                // Could not swet with fluent:
                Debug = false,
                CachingProvider = new DefaultCachingProvider(),
                TemplateManager = new DelegateTemplateManager()
            };
stusklinar commented 6 years ago

What does your view look like? Are you running in debug mode?

hidegh commented 6 years ago

Hi, just deployed and created a quick test on a server, so no debugger attached, debug from web.config even turned off. But debug constants were included into build and no code opt. was allowed at build.

initial call (with compiling) = 4,6sec upcoming calls = 0,76sec

RazorEngine 3.1, .NET core 2.0 targetting full 4.6.3.

stusklinar commented 6 years ago

Ok - but what does the view look like?

Can you provide a Github repo example?

This is currently like telling me your car is running badly without telling me what car you have, or even showing it to me.

hidegh commented 6 years ago

Here U go, this is the template that is filled out / rendered.

When I was trying simple use-cases, I was never able (nor with 3-4 param) achieve anything around 20ms aft. compiling...always 100+ ms per. template.

<fields>
<field key="A_DOCUMENT_NUMBER" type="text">@Model.Packet.PacketI9.ListADocumentNumber</field>
<field key="A_DOCUMENT_TITLE" type="text">@Model.Packet.PacketI9.ListADocumentTitle</field>
<field key="A_EXPIRATION_DATE" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.Packet.PacketI9.ListAExpirationDate))</field>
<field key="A_ISSUING_AUTHORITY" type="text">@Model.Packet.PacketI9.ListAIssuingAuthority</field>
<field key="ACCOUNT_NUMBER" type="text">@Model.PacketFields4PDF.BankAccountNumber</field>
<field key="ACCOUNT_TYPE" type="text">@Model.Packet.PacketData.BankAccountType</field>
<field key="ACCOUNT_TYPE_OTHER" type="text">@Model.PacketFields4PDF.BankAccountTypeOther</field>
<field key="ALTERNATE_PHONE" type="text">@Model.Packet.PacketData.AlternatePhone</field>
<field key="ALTERNATE_PHONE_334" type="text">@Model.PacketFields4PDF.AlternatePhone334</field>
<field key="B_DOCUMENT_NUMBER" type="text">@Model.Packet.PacketI9.ListBDocumentNumber</field>
<field key="B_DOCUMENT_TITLE" type="text">@Model.Packet.PacketI9.ListBDocumentTitle</field>
<field key="B_EXPIRATION_DATE" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.Packet.PacketI9.ListBExpirationDate))</field>
<field key="B_ISSUING_AUTHORITY" type="text">@Model.Packet.PacketI9.ListBIssuingAuthority</field>
<field key="BANK_DESCRIPTION" type="text">@Model.Packet.PacketData.BankNameCityState</field>
<field key="BIRTH_DATE" type="text">@string.Format("{0:MM/dd/yyyy}", Model.Packet.BirthDate)</field>
<field key="BIRTH_DATE_BETWEEN_AGE_16_AND_40" type="text">@Model.PacketFields4PDF.BirthDateBetweenAge16And40</field>
<field key="BIRTH_DATE_MM_DD_YY" type="text">@string.Format("{0:MM dd yy}", Model.Packet.BirthDate)</field>
<field key="BIRTH_DATE_MM_DD_YYYY" type="text">@string.Format("{0:MM dd yyyy}", Model.Packet.BirthDate)</field>
<field key="BIRTH_DATE_MMDDYY" type="text">@string.Format("{0:MMddyy}", Model.Packet.BirthDate)</field>
<field key="BIRTH_DATE_MMDDYYYY" type="text">@string.Format("{0:MMddyyyy}", Model.Packet.BirthDate)</field>
<field key="BIRTH_DATE_UNDER_AGE_40" type="text">@Model.PacketFields4PDF.BirthDateUnderAge40</field>
<field key="BLOOD_TYPE" type="text">@Model.Packet.PacketData.BloodType</field>
<field key="C_DOCUMENT_NUMBER" type="text">@Model.Packet.PacketI9.ListCDocumentNumber</field>
<field key="C_DOCUMENT_TITLE" type="text">@Model.Packet.PacketI9.ListCDocumentTitle</field>
<field key="C_EXPIRATION_DATE" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.Packet.PacketI9.ListCExpirationDate))</field>
<field key="C_ISSUING_AUTHORITY" type="text">@Model.Packet.PacketI9.ListCIssuingAuthority</field>
<field key="CELL_PHONE" type="text">@Model.Packet.PacketData.CellPhone</field>
<field key="CELL_PHONE_334" type="text">@Model.PacketFields4PDF.CellPhone334</field>
<field key="CITIZENSHIP_ALIEN_AUHORIZED_TO_WORK_UNTIL_DDMMYYY" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.Packet.PacketI9.CitizenshipAlienAuhorizedToWorkUntil))</field>
<field key="CITIZENSHIP_ALIEN_REGISTRATION_OR_USCIS_NUMBER" type="text">@Model.Packet.PacketI9.CitizenshipAlienRegistrationOrUscisNumber</field>
<field key="CITIZENSHIP_ALIEN_REGISTRATION_OR_USCIS_NUMBER_A" type="text">@((Model.Packet.PacketI9.CitizenshipType == (int)CitizenshipTypeEnum.AlienAuthorizedToWorkUntil) ? Model.Packet.PacketI9.CitizenshipAlienRegistrationOrUscisNumber : "")</field>
<field key="CITIZENSHIP_ALIEN_REGISTRATION_OR_USCIS_NUMBER_R" type="text">@((Model.Packet.PacketI9.CitizenshipType == (int)CitizenshipTypeEnum.PermanentResident) ? Model.Packet.PacketI9.CitizenshipAlienRegistrationOrUscisNumber : "")</field>
<field key="CITIZENSHIP_DESCRIPTION" type="text">@(Model.Packet.PacketI9.CitizenshipType != null ? ((CitizenshipTypeEnum)Model.Packet.PacketI9.CitizenshipType).GetAttribute<DisplayAttribute>().Name : "")</field>
<field key="CITIZENSHIP_FORMI94_ADMISSION_NUMBER" type="text">@Model.Packet.PacketI9.CitizenshipFormI94AdmissionNumber</field>
<field key="CITIZENSHIP_FORMI94_COUNTRY_OF_ISSUANCE" type="text">@Model.Packet.PacketI9.CitizenshipFormI94CountryOfIssuance</field>
<field key="CITIZENSHIP_FORMI94_FOREIGN_PASSPORT_NUMBER" type="text">@Model.Packet.PacketI9.CitizenshipFormI94ForeignPassportNumber</field>
<field key="CITIZENSHIP_ID" type="text">@(Model.Packet.PacketI9.CitizenshipType != null ? ((CitizenshipTypeEnum)Model.Packet.PacketI9.CitizenshipType).GetAttribute<DisplayAttribute>().ShortName : "")</field>
<field key="CITIZENSHIP_TYPE" type="text">@(string.Format("{0}", Model.Packet.PacketI9.CitizenshipType))</field>
<field key="CITY_STATE_ZIP" type="text">@(Model.Packet.PacketData.PrimaryCity + " " + Model.Packet.PacketData.PrimaryState + " " + Model.Packet.PacketData.PrimaryZipCode)</field>
<field key="COMPANY_AGENT" type="text">Drugtest, Inc dba DISA, Inc. 12600 Northborough Drive Houston, TX 77067</field>
<field key="CONTACT_ADDRESS" type="text">@Model.Packet.Company.ContactAddress</field>
<field key="CONTACT_CITY" type="text">@Model.Packet.Company.ContactCity</field>
<field key="CONTACT_CITY_STATE_ZIP" type="text">@(new StringConcat(Model.Packet.Company.ContactCity, Model.Packet.Company.ContactState, Model.Packet.Company.ContactZIP).Format("{0}{, |1}{ |2}"))</field>
<field key="CONTACT_NAME" type="text">@Model.Packet.Company.ContactName</field>
<field key="CONTACT_STATE" type="text">@Model.Packet.Company.ContactState</field>
<field key="CONTACT_TELEPHONE_NUMBER" type="text">@Model.Packet.Company.ContactTelephoneNumber</field>
<field key="CONTACT_ZIP" type="text">@Model.Packet.Company.ContactZIP</field>
<field key="COUNTY_RESIDENCE_COUNT" type="text">@Model.Packet.PacketData.CountyResidenceCount</field>
<field key="CURRENTLY_MEDICATING" type="text">@Model.Packet.PacketData.CurrentlyMedicating</field>
<field key="DEPENDENT_CHILDREN_COUNT" type="text">@Model.Packet.PacketData.DependentChildrenCount</field>
<field key="DIRECT_DEPOSIT" type="text">@Model.Packet.PacketData.DirectDeposit</field>
<field key="DRIVERS_LICENSE_EXP_DATE" type="text">@Model.PacketFields4PDF.DriversLicenseExpirationDate</field>
<field key="DRIVERS_LICENSE_NUMBER" type="text">@Model.PacketFields4PDF.DriversLicenseNumber</field>
<field key="DRIVERS_LICENSE_STATE" type="text">@Model.PacketFields4PDF.DriversLicenseState</field>
<field key="EMAIL" type="text">@Model.Packet.Email</field>
<field key="EMPLOYEE_INITIALS" type="text">@((Model.Packet as INameDetailDto).GetInitials())</field>
<field key="EMPLOYEE_SIGN_PRINTED_NAME" type="text">@Model.SignDetails.Signer.DigitalName</field>
<field key="EMPLOYEE_SIGN_SIGNATURE" type="text">@Model.SignDetails.Signer.DigitalSignature</field>
<field key="EMPLOYEE_SIGN_SIGNED_DATE" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.SignDetails.SignDate))</field>
<field key="EMPLOYEE_SIGN_SIGNED_DATE_YY" type="text">@(string.Format("{0:yy}", Model.SignDetails.SignDate))</field>
<field key="EMPLOYEE_SIGN_SIGNED_DATE_YYYY" type="text">@(string.Format("{0:yyyy}", Model.SignDetails.SignDate))</field>
<field key="EMPLOYER_ADDRESS" type="text">@Model.Packet.Company.Address</field>
<field key="EMPLOYER_ADDRESS_TELEPHONE" type="text">@(string.Format("{0}, {1}", Model.Packet.Company.Address, Model.Packet.Company.TelephoneNumber))</field>
<field key="EMPLOYER_CITY" type="text">@Model.Packet.Company.City</field>
<field key="EMPLOYER_CITY_STATE_ZIP" type="text">@(new StringConcat(Model.Packet.Company.City, Model.Packet.Company.State, Model.Packet.Company.ZIP).Format("{0}{, |1}{ |2}"))</field>
<field key="EMPLOYER_EIN" type="text">@Model.Packet.Company.EIN</field>
<field key="EMPLOYER_EIN_XX" type="text">@((Model.Packet.Company.EIN ?? "").Replace("-", ""))</field>
<field key="EMPLOYER_FULL_ADDRESS" type="text">@(string.Format("{0}, {1}, {2} {3}", Model.Packet.Company.Address, Model.Packet.Company.City, Model.Packet.Company.ZIP, Model.Packet.Company.State))</field>
<field key="EMPLOYER_NAME" type="text">@Model.Packet.Company.Name</field>
<field key="EMPLOYER_NAME_FULL_ADDRESS" type="text">@(string.Format("{0}, {1}, {2}, {3} {4}", Model.Packet.Company.Name, Model.Packet.Company.Address, Model.Packet.Company.City, Model.Packet.Company.ZIP, Model.Packet.Company.State))</field>
<field key="EMPLOYER_STATE" type="text">@Model.Packet.Company.State</field>
<field key="EMPLOYER_TELEPHONE_NUMBER" type="text">@Model.Packet.Company.TelephoneNumber</field>
<field key="EMPLOYER_TELEPHONE_NUMBER_334" type="text">@Model.PacketFields4PDF.EmployerTelephoneNumber334</field>
<field key="EMPLOYER_ZIP" type="text">@Model.Packet.Company.ZIP</field>
<field key="ETHNICITY" type="text">@Model.Packet.PacketData.Ethnicity</field>
<field key="ETHNICITY_CHOICE" type="text">@Model.PacketFields4PDF.PdfEthnicityChoice</field>
<field key="ETHNICITY_OTHER_THAN_ASIAN_BLACKAA_WHITE_HISPLATINO" type="text">@Model.PacketFields4PDF.EthnicityOtherThanAsianBlackaaWhiteHisplatino</field>
<field key="EXPENSES_ACCOUNT_NUMBER" type="text">@Model.PacketFields4PDF.ExpBankAccountNumber</field>
<field key="EXPENSES_ACCOUNT_TYPE" type="text">@Model.Packet.PacketData.ExpBankAccountType</field>
<field key="EXPENSES_ACCOUNT_TYPE_OTHER" type="text">@Model.PacketFields4PDF.ExpBankAccountTypeOther</field>
<field key="EXPENSES_BANK_DESCRIPTION" type="text">@Model.Packet.PacketData.ExpBankNameCityState</field>
<field key="EXPENSES_REIMBURSEMENT" type="text">@Model.Packet.PacketData.ExpReimbursement</field>
<field key="EXPENSES_ROUTING_TRANSIT_NUMBER" type="text">@Model.PacketFields4PDF.ExpBankRoutingTransitNumber</field>
<field key="EXPENSES_SAME_AS_DIRECT_DEPOSIT" type="text">@Model.Packet.PacketData.ExpSameAsDirectDeposit</field>
<field key="EXPENSES_USE_DD_ACCOUNT" type="text">@Model.PacketFields4PDF.ExpUseDdAccount</field>
<field key="EXPENSES_USE_EXP_ACCOUNT" type="text">@Model.PacketFields4PDF.ExpUseExpAccount</field>
<field key="FEDERAL_EXEMPT" type="text">@Model.Packet.PacketData.FederalExempt</field>
<field key="FEDERAL_MARITAL_STATUS" type="text">@Model.Packet.PacketData.FederalMaritalStatus</field>
<field key="FEDERAL_MARITAL_STATUS_MARRIED" type="text">@(Model.Packet.PacketData.FederalMaritalStatus == "Married" ? "On" : string.Empty)</field>
<field key="FEDERAL_MARITAL_STATUS_MARRIED_SINGLE_RATE" type="text">@(Model.Packet.PacketData.FederalMaritalStatus == "Married, but withhold at higher Single rate" ? "On" : string.Empty)</field>
<field key="FEDERAL_MARITAL_STATUS_SINGLE" type="text">@(Model.Packet.PacketData.FederalMaritalStatus == "Single" ? "On" : string.Empty)</field>
<field key="FEDERAL_NUMBER_OF_PAYROLL_ALLOWANCES" type="text">@Model.Packet.PacketData.FederalNumberOfPayrollAllowances</field>
<field key="FEDERAL_WITHHOLD_AMOUNT" type="text">@(string.Format("{0:N}", Model.Packet.PacketData.FederalWithholdAmount))</field>
<field key="FIRST_NAME" type="text">@Model.Packet.FirstName</field>
<field key="FIRST_NAME_MI" type="text">@((Model.Packet as INameDetailDto).Format("{FN}{ |MN1}"))</field>
<field key="FIRST_NAME_MI_LAST_NAME" type="text">@((Model.Packet as INameDetailDto).Format("{FN}{ |MN1}{ |LN}"))</field>
<field key="FIRST_NAME_MI_LAST_NAME_SUFFIX" type="text">@((Model.Packet as INameDetailDto).Format("{FN}{ |MN1}{ |LN}{ |NS}"))</field>
<field key="FIRST_NAME_MIDDLE_NAME_LAST_NAME_SUFFIX" type="text">@((Model.Packet as INameDetailDto).Format("{FN}{ |MN}{ |LN}{ |NS}"))</field>
<field key="FORM_8850_CHECK_1" type="text">@Model.Packet.PacketData.Form8850Check1</field>
<field key="FORM_8850_CHECK_2" type="text">@Model.Packet.PacketData.Form8850Check2</field>
<field key="FORM_8850_CHECK_3" type="text">@Model.Packet.PacketData.Form8850Check3</field>
<field key="FORM_8850_CHECK_4" type="text">@Model.Packet.PacketData.Form8850Check4</field>
<field key="FORM_8850_CHECK_5" type="text">@Model.Packet.PacketData.Form8850Check5</field>
<field key="FORM_8850_CHECK_6" type="text">@Model.Packet.PacketData.Form8850Check6</field>
<field key="FORM_9061_BOX12_NO" type="text">@Model.PacketFields4PDF.Form9061Box12No</field>
<field key="FORM_9061_BOX12_YES" type="text">@Model.PacketFields4PDF.Form9061Box12Yes</field>
<field key="FORM_9061_BOX13_CITY_AND_STATE" type="text">@Model.Packet.PacketData.Form9061Box13CityAndState</field>
<field key="FORM_9061_BOX13_NO_1" type="text">@Model.PacketFields4PDF.Form9061Box13No1</field>
<field key="FORM_9061_BOX13_NO_2" type="text">@Model.PacketFields4PDF.Form9061Box13No2</field>
<field key="FORM_9061_BOX13_NO_3" type="text">@Model.PacketFields4PDF.Form9061Box13No3</field>
<field key="FORM_9061_BOX13_NO_4" type="text">@Model.PacketFields4PDF.Form9061Box13No4</field>
<field key="FORM_9061_BOX13_NO_5" type="text">@Model.PacketFields4PDF.Form9061Box13No5</field>
<field key="FORM_9061_BOX13_PRIMARY_RECIPIENT" type="text">@Model.Packet.PacketData.Form9061Box13PrimaryRecipient</field>
<field key="FORM_9061_BOX13_YES_1" type="text">@Model.PacketFields4PDF.Form9061Box13Yes1</field>
<field key="FORM_9061_BOX13_YES_2" type="text">@Model.PacketFields4PDF.Form9061Box13Yes2</field>
<field key="FORM_9061_BOX13_YES_3" type="text">@Model.PacketFields4PDF.Form9061Box13Yes3</field>
<field key="FORM_9061_BOX13_YES_4" type="text">@Model.PacketFields4PDF.Form9061Box13Yes4</field>
<field key="FORM_9061_BOX13_YES_5" type="text">@Model.PacketFields4PDF.Form9061Box13Yes5</field>
<field key="FORM_9061_BOX14_CITY_AND_STATE" type="text">@Model.Packet.PacketData.Form9061Box14CityAndState</field>
<field key="FORM_9061_BOX14_NO_1" type="text">@Model.PacketFields4PDF.Form9061Box14No1</field>
<field key="FORM_9061_BOX14_NO_2" type="text">@Model.PacketFields4PDF.Form9061Box14No2</field>
<field key="FORM_9061_BOX14_PRIMARY_RECIPIENT" type="text">@Model.Packet.PacketData.Form9061Box14PrimaryRecipient</field>
<field key="FORM_9061_BOX14_YES_1" type="text">@Model.PacketFields4PDF.Form9061Box14Yes1</field>
<field key="FORM_9061_BOX14_YES_2" type="text">@Model.PacketFields4PDF.Form9061Box14Yes2</field>
<field key="FORM_9061_BOX15_NO_1" type="text">@Model.PacketFields4PDF.Form9061Box15No1</field>
<field key="FORM_9061_BOX15_NO_2" type="text">@Model.PacketFields4PDF.Form9061Box15No2</field>
<field key="FORM_9061_BOX15_NO_3" type="text">@Model.PacketFields4PDF.Form9061Box15No3</field>
<field key="FORM_9061_BOX15_YES_1" type="text">@Model.PacketFields4PDF.Form9061Box15Yes1</field>
<field key="FORM_9061_BOX15_YES_2" type="text">@Model.PacketFields4PDF.Form9061Box15Yes2</field>
<field key="FORM_9061_BOX15_YES_3" type="text">@Model.PacketFields4PDF.Form9061Box15Yes3</field>
<field key="FORM_9061_BOX16_CITY_AND_STATE" type="text">@Model.Packet.PacketData.Form9061Box16CityAndState</field>
<field key="FORM_9061_BOX16_NO_1" type="text">@Model.PacketFields4PDF.Form9061Box16No1</field>
<field key="FORM_9061_BOX16_NO_2" type="text">@Model.PacketFields4PDF.Form9061Box16No2</field>
<field key="FORM_9061_BOX16_NO_3" type="text">@Model.PacketFields4PDF.Form9061Box16No3</field>
<field key="FORM_9061_BOX16_NO_4" type="text">@Model.PacketFields4PDF.Form9061Box16No4</field>
<field key="FORM_9061_BOX16_PRIMARY_RECIPIENT" type="text">@Model.Packet.PacketData.Form9061Box16PrimaryRecipient</field>
<field key="FORM_9061_BOX16_YES_1" type="text">@Model.PacketFields4PDF.Form9061Box16Yes1</field>
<field key="FORM_9061_BOX16_YES_2" type="text">@Model.PacketFields4PDF.Form9061Box16Yes2</field>
<field key="FORM_9061_BOX16_YES_3" type="text">@Model.PacketFields4PDF.Form9061Box16Yes3</field>
<field key="FORM_9061_BOX16_YES_4" type="text">@Model.PacketFields4PDF.Form9061Box16Yes4</field>
<field key="FORM_9061_BOX17_DATE_CONVICTION" type="text">@Model.Packet.PacketData.Form9061Box17DateOfConviction</field>
<field key="FORM_9061_BOX17_DATE_RELEASE" type="text">@Model.Packet.PacketData.Form9061Box17DateOfRelease</field>
<field key="FORM_9061_BOX17_FEDERAL" type="text">@Model.Packet.PacketData.Form9061Box17FederalConviction</field>
<field key="FORM_9061_BOX17_NO" type="text">@Model.PacketFields4PDF.Form9061Box17No</field>
<field key="FORM_9061_BOX17_STATE" type="text">@Model.Packet.PacketData.Form9061Box17StateConviction</field>
<field key="FORM_9061_BOX17_YES" type="text">@Model.PacketFields4PDF.Form9061Box17Yes</field>
<field key="FORM_9061_BOX18_NO" type="text">@Model.PacketFields4PDF.Form9061Box18No</field>
<field key="FORM_9061_BOX18_YES" type="text">@Model.PacketFields4PDF.Form9061Box18Yes</field>
<field key="FORM_9061_BOX19_NO" type="text">@Model.PacketFields4PDF.Form9061Box19No</field>
<field key="FORM_9061_BOX19_YES" type="text">@Model.PacketFields4PDF.Form9061Box19Yes</field>
<field key="FORM_9061_BOX20_NO" type="text">@Model.PacketFields4PDF.Form9061Box20No</field>
<field key="FORM_9061_BOX20_YES" type="text">@Model.PacketFields4PDF.Form9061Box20Yes</field>
<field key="FORM_9061_BOX21_NO" type="text">@Model.PacketFields4PDF.Form9061Box21No</field>
<field key="FORM_9061_BOX21_YES" type="text">@Model.PacketFields4PDF.Form9061Box21Yes</field>
<field key="FORM_9061_BOX22_NO" type="text">@Model.PacketFields4PDF.Form9061Box22No</field>
<field key="FORM_9061_BOX22_YES" type="text">@Model.PacketFields4PDF.Form9061Box22Yes</field>
<field key="FORM_9061_BOX23" type="text">@Model.Packet.PacketData.Form9061Box23</field>
<field key="FORM_9061_BOX8_NO" type="text">@Model.PacketFields4PDF.Form9061Box8No</field>
<field key="FORM_9061_BOX8_YES" type="text">@Model.PacketFields4PDF.Form9061Box8Yes</field>
<field key="FULL_NAME" type="text">@((Model.Packet as INameDetailDto).GetFullName())</field>
<field key="GENDER" type="text">@Model.Packet.Gender</field>
<field key="GENDER_CHOICE" type="text">@Model.PacketFields4PDF.PdfGenderChoice</field>
<field key="HISPANIC_ETHNICITY" type="text">@Model.PacketFields4PDF.IsHispanicOrLatinoEthnicity</field>
<field key="HOME_ADDRESS" type="text">@(Model.Packet.PacketData.PrimaryStreetAddress + ", " + Model.Packet.PacketData.PrimaryCity + ", " + Model.Packet.PacketData.PrimaryState + " " + Model.Packet.PacketData.PrimaryZipCode)</field>
<field key="HOME_PHONE" type="text">@Model.Packet.PacketData.HomePhone</field>
<field key="HOME_PHONE_334" type="text">@Model.PacketFields4PDF.HomePhone334</field>
<field key="HR_EMPLOYEE_TITLE" type="text">@Model.SignDetails.CounterSigner.JobTitle</field>
<field key="HR_FIRST_NAME" type="text">@Model.SignDetails.CounterSigner.FirstName</field>
<field key="HR_HIRE_DATE" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.Packet.PacketHrFields.HrHireDate))</field>
<field key="HR_HOURLY_RATE" type="text">@(string.Format("{0:N}", Model.Packet.PacketHrFields.HrHourlyRate))</field>
<field key="HR_LAST_NAME" type="text">@Model.SignDetails.CounterSigner.LastName</field>
<field key="HR_REHIRE_YN" type="text">@Model.PacketFields4PDF.HrRehireYn</field>
<field key="HR_SIGN_PRINTED_NAME" type="text">@Model.SignDetails.CounterSigner.DigitalName</field>
<field key="HR_SIGN_SIGNATURE" type="text">@Model.SignDetails.CounterSigner.DigitalSignature</field>
<field key="HR_SIGN_SIGNED_DATE" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.SignDetails.CounterSignDate))</field>
<field key="HRUSER_LAST4SSN" type="text">@Model.SignDetails.CounterSigner.SsnLast4</field>
<field key="I9_FIRST_DAY_EMPLOYMENT" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.Packet.PacketI9.FirstDayOfEmployment))</field>
<field key="INSURANCE_CARRIER_NAME" type="text">@Model.Packet.PacketData.InsuranceCarrierName</field>
<field key="INSURANCE_CONTACT_NAME" type="text">@Model.Packet.PacketData.InsuranceContactName</field>
<field key="INSURANCE_CONTACT_PHONE" type="text">@Model.Packet.PacketData.InsuranceContactPhone</field>
<field key="INSURANCE_POLICY_NUMBER" type="text">@Model.Packet.PacketData.InsurancePolicyNumber</field>
<field key="KNOWN_ALLERGIES" type="text">@Model.Packet.PacketData.KnownAllergies</field>
<field key="LAST_EMPLOYMENT_DATE" type="text">@Model.Packet.PacketData.LastEmploymentDate</field>
<field key="LAST_FIRST_MI" type="text">@((Model.Packet as INameDetailDto).Format("{LN}{ |FN}{ |MN1}"))</field>
<field key="LAST_NAME" type="text">@Model.Packet.LastName</field>
<field key="LAST_NAME_SUFFIX" type="text">@((Model.Packet as INameDetailDto).Format("{LN}{ |NS}"))</field>
<field key="LAST_SUFFIX_FIRST_MI" type="text">@((Model.Packet as INameDetailDto).Format("{LN}{ |NS}{ |FN}{ |MN1}"))</field>
<field key="LAST_SUFFIX_FIRST_MIDDLE" type="text">@((Model.Packet as INameDetailDto).Format("{LN}{ |NS}{ |FN}{ |MN}"))</field>
<field key="LASTNAME_FIRSTNAME_MI" type="text">@((Model.Packet as INameDetailDto).Format("{LN}{ |FN}{ |MN1}"))</field>
<field key="LASTNAME_SUFFIX_FIRSTNAME_MI" type="text">@((Model.Packet as INameDetailDto).Format("{LN}{ |NS}{ |FN}{ |MN1}"))</field>
<field key="LASTNAME_SUFFIX_FIRSTNAME_MIDDLENAME" type="text">@((Model.Packet as INameDetailDto).Format("{LN}{ |NS}{ |FN}{ |MN}"))</field>
<field key="LIVING_WILL" type="text">@Model.Packet.PacketData.LivingWill</field>
<field key="MARITAL_STATUS" type="text">@Model.Packet.PacketData.MaritalStatus</field>
<field key="MEDICAL_RECORDS" type="text">@Model.Packet.PacketData.MedicalRecords</field>
<field key="MEDICATION_01" type="text">@Model.Packet.PacketData.Medication1</field>
<field key="MEDICATION_02" type="text">@Model.Packet.PacketData.Medication2</field>
<field key="MEDICATION_03" type="text">@Model.Packet.PacketData.Medication3</field>
<field key="MEDICATION_04" type="text">@Model.Packet.PacketData.Medication4</field>
<field key="MIDDLE_INITIAL" type="text">@((Model.Packet.MiddleName ?? "").Length > 0 ? Model.Packet.MiddleName[0].ToString() : "")</field>
<field key="MIDDLE_NAME" type="text">@Model.Packet.MiddleName</field>
<field key="OTHER_LAST_NAMES" type="text">@Model.Packet.OtherLastNames</field>
<field key="PAST_SURGERIES" type="text">@Model.Packet.PacketData.PastSurgeries</field>
<field key="POSITION" type="text">@Model.Packet.PacketData.Position</field>
<field key="PREPARER_APARTMENT_NUMBER" type="text">@Model.Packet.PacketI9.PreparerApartmentNumber</field>
<field key="PREPARER_CITY" type="text">@Model.Packet.PacketI9.PreparerCity</field>
<field key="PREPARER_COUNTRY" type="text">@Model.Packet.PacketI9.PreparerCounty</field>
<field key="PREPARER_DATE" type="text">@(string.Format("{0:MM/dd/yyyy}", Model.Packet.PacketI9.PreparerDate))</field>
<field key="PREPARER_FIRST_NAME" type="text">@Model.Packet.PacketI9.PreparerFirstName</field>
<field key="PREPARER_LAST_NAME" type="text">@Model.Packet.PacketI9.PreparerLastName</field>
<field key="PREPARER_NOT_USED" type="text">@(string.Format("{0}", Model.Packet.PacketI9.PreparerNotUsed))</field>
<field key="PREPARER_SIGNATURE" type="text">@Model.Packet.PacketI9.PreparerSignature</field>
<field key="PREPARER_STATE" type="text">@Model.Packet.PacketI9.PreparerState</field>
<field key="PREPARER_STREET_ADDRESS" type="text">@Model.Packet.PacketI9.PreparerStreetAddress</field>
<field key="PREPARER_ZIP_CODE" type="text">@Model.Packet.PacketI9.PreparerZipCode</field>
<field key="PRIMARY_APARTMENT_NUMBER" type="text">@Model.Packet.PacketData.PrimaryApartmentNumber</field>
<field key="PRIMARY_CITY" type="text">@Model.Packet.PacketData.PrimaryCity</field>
<field key="PRIMARY_COUNTY" type="text">@Model.Packet.PacketData.PrimaryCounty</field>
<field key="PRIMARY_EMERGENCY_CONTACT_NAME" type="text">@Model.Packet.PacketData.PrimaryEmergencyContactName</field>
<field key="PRIMARY_EMERGENCY_PHONE" type="text">@Model.Packet.PacketData.PrimaryEmergencyContactPhone</field>
<field key="PRIMARY_EMERGENCY_RELATIONSHIP" type="text">@Model.Packet.PacketData.PrimaryEmergencyContactRelationship</field>
<field key="PRIMARY_PHYSICIAN_CITY" type="text">@Model.Packet.PacketData.PrimaryPhysicianCity</field>
<field key="PRIMARY_PHYSICIAN_NAME" type="text">@Model.Packet.PacketData.PrimaryPhysicianName</field>
<field key="PRIMARY_PHYSICIAN_PHONE" type="text">@Model.Packet.PacketData.PrimaryPhysicianPhone</field>
<field key="PRIMARY_PHYSICIAN_STATE" type="text">@Model.Packet.PacketData.PrimaryPhysicianState</field>
<field key="PRIMARY_PHYSICIAN_STREET_ADDRESS" type="text">@Model.Packet.PacketData.PrimaryPhysicianStreetAddress</field>
<field key="PRIMARY_PHYSICIAN_SUITE_NUMBER" type="text">@Model.Packet.PacketData.PrimaryPhysicianSuiteNumber</field>
<field key="PRIMARY_PHYSICIAN_ZIP" type="text">@Model.Packet.PacketData.PrimaryPhysicianZip</field>
<field key="PRIMARY_STATE" type="text">@Model.Packet.PacketData.PrimaryState</field>
<field key="PRIMARY_STREET_ADDRESS" type="text">@Model.Packet.PacketData.PrimaryStreetAddress</field>
<field key="PRIMARY_STREET_ADDRESS_APARTMENT_NUMBER" type="text">@(new StringConcat(Model.Packet.PacketData.PrimaryStreetAddress, Model.Packet.PacketData.PrimaryApartmentNumber).Format("{0}{ / |1}"))</field>
<field key="PRIMARY_ZIP_CODE" type="text">@Model.Packet.PacketData.PrimaryZipCode</field>
<field key="ROUTING_TRANSIT_NUMBER" type="text">@Model.PacketFields4PDF.BankRoutingTransitNumber</field>
<field key="SECONDARY_APARTMENT_NUMBER" type="text">@Model.Packet.PacketData.SecondaryApartmentNumber</field>
<field key="SECONDARY_CITY" type="text">@Model.Packet.PacketData.SecondaryCity</field>
<field key="SECONDARY_COUNTY" type="text">@Model.Packet.PacketData.SecondaryCounty</field>
<field key="SECONDARY_EMERGENCY_CONTACT_NAME" type="text">@Model.Packet.PacketData.SecondaryEmergencyContactName</field>
<field key="SECONDARY_EMERGENCY_PHONE" type="text">@Model.Packet.PacketData.SecondaryEmergencyContactPhone</field>
<field key="SECONDARY_EMERGENCY_RELATIONSHIP" type="text">@Model.Packet.PacketData.SecondaryEmergencyContactRelationship</field>
<field key="SECONDARY_STATE" type="text">@Model.Packet.PacketData.SecondaryState</field>
<field key="SECONDARY_STREET_ADDRESS" type="text">@Model.Packet.PacketData.SecondaryStreetAddress</field>
<field key="SECONDARY_ZIP_CODE" type="text">@Model.Packet.PacketData.SecondaryZipCode</field>
<field key="SSN" type="text">@Model.Packet.Ssn</field>
<field key="SSN_XX" type="text">@Model.Packet.Ssn.Replace("-", "")</field>
<field key="VETERAN_STATUS" type="text">@Model.PacketFields4PDF.PdfVeteranStatus</field>
<field key="DRIVERS_LICENSE_NUMBER_AND_STATE" type="text">@(new StringConcat(Model.PacketFields4PDF.DriversLicenseNumber, Model.PacketFields4PDF.DriversLicenseState).Format("{0}{, |1}"))</field>
<field key="PRIMARY_STATE_ZIP" type="text">@(new StringConcat(Model.Packet.PacketData.PrimaryState, Model.Packet.PacketData.PrimaryZipCode).Format("{0}{, |1}"))</field>
</fields>
stusklinar commented 6 years ago

Right you're going have to help me to help you.

That's a view, with some custom model.

I can't do anything with that.

Can you provide sample code, as I've already asked?

As in a fully working example.

hidegh commented 6 years ago

The project is internal, can't share more.

Since others had similar issues, strongly hoped that providing view and settings we find some reasons (strongly hoped it's just some settings).

I can ev. try to get the compiled class, add it to the solution, see how that performs...

stusklinar commented 6 years ago

I'm not asking you to share your while project.

But surely you can make a small application with a bare model that matches this?