Base solution for your next web application

Activities of "pascald"

Question

HI,

I created an entity with a string ID.

public class Location : FullAuditedEntity<string> , IMustHaveTenant
    {
			public int TenantId { get; set; }
			

		[Required]
		[StringLength(LocationConsts.MaxDescriptionLength, MinimumLength = LocationConsts.MinDescriptionLength)]
		public virtual string Description { get; set; }
		

    }

As the ID must be provided by the user and the CreateOrEdit is using the ID to decide to do an edit or an insert (and it is never empty in this case) what would be the best way to handle this situation.

Also how to validate for duplicate IDs ? Should I add a function in my LocationsAppService to make the validation on the client side?

Thanks,

Pascal

I have a similar issue with drop down boxes that are empty on reload after hitting the cancel button. Strange thing is that it happens in Chrome/Edge but not in Safari...

It would be nice to have a public answer if you have a solution.

(Left Safari, Right Chrome)

Answer

Hi,

I was sure I had tried this file but now it works... working too late probably...

Thanks,

Pascal

Answer

Separate

Question

Hi,

I am building a project based on ASP.Net Core and Angular.

I can run the project fone on my dev machine.

I published the project on my test server and after a while I was able to make it work...

The problem is that I have 404 errors when I refresh a page or when I pass from the host to a tenant. I tried to follow all tips here and Ican't make it work.

I added the rewrite section to the web.config but this gives me a too many redirect" error.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
    <!-- IIS URL Rewrite for Angular routes -->
    <rewrite>
      <rules>
	        <rule name="Angular Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>

      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\Eteriors.Web.Host.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />    
    </system.webServer>
  </location>
</configuration>

Here is the Chrome Network log:

It had a hard to figure out the correct settings for Cors but it is now working fine but I can't find the correct setting for that one.

What I am missing ?

Thanks,

Pascal

Could you please send some sample code to [email protected]

Thanks!

Showing 1 to 6 of 6 entries