Quick question,
The last hour I've been wondering why the migrations of my module don't get picked up by de DbMigrator. Looking in an older project (v5) I found some code that was not in the EntityFrameworkCore{ApplicationName}DbSchemaMigrator in my V9.0.0 solution:
/*
* Modules Migrations:
* One call for each AbpModule DbContext.
*/
await _serviceProvider
.GetRequiredService<{ModuleName}.EntityFrameworkCore.{ModuleName}DbContext>()
.Database
.MigrateAsync();
After putting this in it worked like a charm. Is this code supposed to be generated when using 'abp add-module ....' ? or should we just add this manually because I couldn't find this in the documentation. In that case I would have to make a not of that ..
Hi,
Took some time but at this time I can make migrations in my module, not really sure why. I suppose the code I initially added wasn't complete.
However the generated migration doesn't compile
it seems the SqlServerModelBuilderExtensions don't get recognised (see picture), it needs the package Microsoft.EntityFrameworkCore.SqlServer which doesn't seem to be installed in the generated module-project {ModuleName}.EntityFrameworkCore
After installing:
install-package Microsoft.EntityFrameworkCore.SqlServer
It compiles/builds again :-)
thank you. I'll look into that.
Yes, that works !! :-D Thank you!
Hi,
The code does not work.
Looking at the gitbhub link, I see that
Response.HasStarted
has not been added to the 'if' statement.
if (context.HttpContext.Response.StatusCode == (int)HttpStatusCode.OK && context.HttpContext.Response.HasStarted == false && // <-- this one context.Result == null) {
Goodmorning Maliming,
Thanks for you quick response :-) I have added the code to the solution.
The AbpNoContentActionFilter class from your response needs to be MyNoContentActionFilter?
When running the code I still get the exception.
When I remove the code from OnActionExecutionAsync(...) which sets the Response.Statuscode, then the exception does not occur.
Is that correct ?
public class MyNoContentActionFilter : IAsyncActionFilter, ITransientDependency
{
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
await next();
}
}
When you correct this in a next release will this be mentioned in the release notes? So we can remove this custom code from our solution ?
maliming,
Thanks, I got this to work.
OnLogOutSucceeded/OnLogInSucceeded are now caught :-)
I have added this 'Authentication.razor' component to my PROJECT.Blazor project. Then I added the Authentication component to my index.razor (her on line 9)
@page "/"
@inherits appFileManagerComponentBase
<div class="row entry-row">
<div class="col-auto">
<h1 class="content-header-title">Welcome to appFileManager!</h1>
</div>
</div>
<Authentication /> // <---- Authentication Inserted here ---->
<Card>
<CardBody>
<h2>
The Tutorial
</h2>
<p>
See the <a href="https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-1?UI=Blazor" target="_blank">Web Application Development Tutorial</a> to learn how to develop
web applications with the ABP Commercial and the Blazor UI.
</p>
</CardBody>
</Card>
However, I'm getting the follwing error
-- Unhandled exception rendering component: Invalid action ''.
I have tried putting 'Login' in action but then the login page is automatically shown and not the index page. Also when I do login, the event 'OnLogInSucceeded' seems to be fired many times...
I'm not sure how proceed from here ...
thank you for your response.
I see various classes in the namespace Volo.Abp.Http.Client.IdentityModel but cannot figure out how to 'hook in' to the events 'after succesful login' and 'after logout'
I'm pretty sure ABP must have some mechanism like that, for instance in it's UI to react to a logoff so the menu can change, the header in the top-right of the screen so the current userinfo can be shown (of not, after logoff).
I don't know how to explain more clearly.
I need an event or hook into the :
Hi Mailiming,
I will look into the IAccessTokenProvider. But I think you missed the questions at the bottom of my message.
We need some way to know when the user has succesfully logged in
so we can (re)set the token in our Csla environment
We also need to know when the user has logged off
so we can clear the token in our Csla environment
I've looked, but I suppose that mechanism is burried deep within the ABP framework. Is there any way we can accomplish this ? maybe using some sort of eventhandler? I'm sure your UI is also reacting to these login/logoff events ?