Base solution for your next web application

Activities of "geertveenstra"

Anyone using postgres as a database here ?

I am getting an exception "Can't write CLR type System.Boolean with handler type Int64Handler" in the OrganizationUnitAppService.FindUsers Postgres does not seem to be able to handle a type long from the User entity ID in the following line

.Where(u => !userIdsInOrganizationUnit.Contains(u.Id))

Here is the full exception from the logfile:

System.InvalidCastException: Can't write CLR type System.Boolean with handler type Int64Handler
   at lambda_method(Closure , NpgsqlTypeHandler , Object , NpgsqlLengthCache& , NpgsqlParameter )
   at Npgsql.TypeHandling.NpgsqlSimpleTypeHandler`1.ValidateObjectAndGetLength(Object value, NpgsqlLengthCache& lengthCache, NpgsqlParameter parameter) in C:\projects\npgsql\src\Npgsql\TypeHandling\NpgsqlSimpleTypeHandler.cs:line 236
   at Npgsql.NpgsqlParameter.ValidateAndGetLength() in C:\projects\npgsql\src\Npgsql\NpgsqlParameter.cs:line 553
   at Npgsql.NpgsqlCommand.ValidateParameters() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 793
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1140
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) in C:\projects\npgsql-entityframeworkcore-postgresql\src\EFCore.PG\Storage\Internal\NpgsqlExecutionStrategy.cs:line 49
   at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.AsyncQueryMethodProvider.GetResult[TResult](IAsyncEnumerable`1 valueBuffers, Boolean throwOnNullResult, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.TaskResultAsyncEnumerable`1.Enumerator.MoveNext(CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteSingletonAsyncQuery[TResult](QueryContext queryContext, Func`2 compiledQuery, IDiagnosticsLogger`1 logger, Type contextType)
   at Portal.Organizations.OrganizationUnitAppService.FindUsers(FindOrganizationUnitUsersInput input) in C:\Users\Administrator\Dropbox\Development\DotNet\Workspaces\Websites\Portal\src\Portal.Application\Organizations\OrganizationUnitAppService.cs:line 159
   at lambda_method(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
  

As a workaround I change the long type to an int type (which off course is not very nice).

Any suggestions to prevent this ?

Should this setting not also be added to the MVC project then ? Since in that project it is also configured in startup.cs as

// Enable middleware to serve generated Swagger as a JSON endpoint
app.UseSwagger();
 // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.)
app.UseSwaggerUI(options =>
{
     options.SwaggerEndpoint(_appConfiguration["App:SwaggerEndPoint"], "Portal API V1");
     options.InjectBaseUrl(_appConfiguration["App:WebSiteRootAddress"]);
 }); //URL: /swagger
Question

Hi,

I was experimenting with the notifications system. I am sending a notification from a background job to a specific user. This works (partly).

After sending the notification, the user sees the popup in the lower right of the screen (but I think this is from the Chrome browser). Only after I do a page refresh i see the red dot above the notification icon in the top bar (the bell).

Is this the normal behaviour or should the icon change directly after the notification was sent ?

I use this method since the beginning

[https://github.com/aspnetzero/aspnet-zero/issues/96#issuecomment-268093697]

I try to change as little as possible in the original files and if really necessary add as many comments as I can so I can recognize it when merging

Is it possible to create some kind of levels in the users management ? So for example a "sub tenant admin" can manage/edit lower level users but not the settings of a "tenant admin"

Or define a user (admin) as "not editable/ not visible" by other users ?

For now, I added this to bundleconfig.json which fixed it for me.

{ "outputFileName": "wwwroot/metronic/src/js/demo/default/base/layout.min.js", "inputFiles": [ "wwwroot/metronic/src/js/demo/default/base/layout.js" ] }, { "outputFileName": "wwwroot/metronic/src/js/demo/demo8/base/layout.min.js", "inputFiles": [ "wwwroot/metronic/src/js/demo/demo8/base/layout.js" ] }

Not sure if it is the final solution, leave that up to you :-)

Probably same as already reported by me for Core & jQuery :

[#5867]

Core & jQuery version :

After uploading to website the menu was not working, seems like the minified layout.min.js files in \wwwroot\metronic\src\js\demo\default\base and wwwroot\metronic\src\js\demo\demo8\base. They are not bundled anymore.

I really do not want to critisize here, but I am wondering why this was not found in testing. Don't you guys publish finished code to a live website to do a minimal test ?

Or am I doing anything wrong in publishing ?

Thanks,

i am having the issue with the CORE & jQuery download, tried several times.

Hi,

I just downloaded the 6.2.0 release, but I get a Web Compiler error when trying to build. Seems like in the compilerconfig.json there is a reference to the following files which are missing ?

wwwroot/Common/Styles/Themes/default/metronic-customize-top-menu.less wwwroot/Common/Styles/Themes/blue/metronic-customize-top-menu.less wwwroot/Common/Styles/Themes/green/metronic-customize-top-menu.less wwwroot/Common/Styles/Themes/pink/metronic-customize-top-menu.less wwwroot/Common/Styles/Themes/yellow/metronic-customize-top-menu.less

There is however a common one (wwwroot/Common/Styles/metronic-customize-top-menu.less) ? Are the files missing or is the compilerconfig.json wrong ?

Sames goes for these entries in the json file wwwroot/view-resources/Areas/App/Views/Layout/default/_Layout.less wwwroot/view-resources/Areas/App/Views/Layout/demo8/_Layout.less

The subfolders do not exist ?

Geert Veenstra

Showing 21 to 30 of 39 entries