GenesysStack.com
RSS

Blog posts of '2018' 'March'

How-to Fix EF Core 2.0 No mapping to a relational type can be found for the CLR type List<SqlParameter>
Entity Framework Core 2.0 (EF 7) contains a great .FromSql(string storedProc, object[] params) method, except for the fact that passing in a List results in a runtime error: No mapping to a relational type can be found for the CLR type List The fix: Convert List<> to Array via .ToArray()
Disallow in prod: alert() and response.write debugging

JS still requires a lot of alert() debugging. A quickie technique to stop that code from bleeding into Dev/qa/prod:

Put this in your _layout.cshtml or window.onload:

        function isDebug() {

            return @(HttpContext.Current.IsDebuggingEnabled);

        }

 Then use in your code:

        if (isDebug) { alert("customers do not want to see this"); }

 

Beware isDebug() is global with this implementation.

Happy coding!