src/Shared/EntityFramework/Core/Metadata/Edm/AspProxy.cs
// <summary>
// Determine whether we are inside an ASP.NET application.
// </summary>
// <returns> true if we are running inside an ASP.NET application </returns>
Determine whether we are inside an ASP.NET application.
Determine whether we are inside an ASP . NET application .
internal bool IsAspNetEnvironment()
        {
            if (!TryInitializeWebAssembly())
            {
                return false;
            }
            try
            {
                var result = InternalMapWebPath(EdmConstants.WebHomeSymbol);
                return result != null;
            }
            catch (SecurityException)
            {
                return false;
            }
            catch (Exception e)
            {
                if (e.IsCatchableExceptionType())
                {
                    return false;
                }
                throw;
            }
        }
internal bool IsAspNetEnvironment ( ) { if ( ! TryInitializeWebAssembly ( ) ) { return false ; } try { var result = InternalMapWebPath ( EdmConstants . WebHomeSymbol ) ; return result != null ; } catch ( SecurityException ) { return false ; } catch ( Exception e ) { if ( e . IsCatchableExceptionType ( ) ) { return false ; } throw ; } }
Determine whether we are inside an ASP.NET application.
Determine whether we are inside an ASP . NET application .
// When running under partial trust but not running as an ASP.NET site the System.Web assembly // may not be not treated as conditionally APTCA and hence throws a security exception. However, // since this happens when not running as an ASP.NET site we can just return false because we're // not in an ASP.NET environment.
true if we are running inside an ASP.NET application
true if we are running inside an ASP . NET application