How to tell angular that application language changed? - angular-translate

How can I tell an angular module from outside of angular that the application language has changed, so the angular module can call the $translate service? Is this possible?

Related

.Net Core multiple Web Api Authencation

i have two .Net Core web api projects(.Net 6)
Project A
Project B
both project are using liteDB database and Vue.js and Electron for bundling
Project A has basic login mechanisum in place.
Project B has no login
Project B internally calls Project A web api through IP Address.
Now the question is i have to implement Authentication mechanism to handle this usecase.
Need your help to suggest best approach to handle this.
Thank you in advance

Running .net application next to asp core app on IIS

I am trying to get my code to run alongside, in process, with an asp core web site.
With .net framework there is an option to create a module. Then, in order to "inject" that module so that it is run when the site runs all I need to do is add the module to web.config or launch it from a .cs file from \app_code.
With asp core, there is a concept called middleware but in order to add a middleware, the user has to write it into their startup code.
I need a way to run my .net core code when the site has started (first page accessed) without requiring the user to change their code to do so. Changing config files after deploy is OK but not compiled files.
Anyone know how to do this?
Thanks.
I see 2 options here:
Hosting startup assemblies
An IHostingStartup (hosting startup) implementation adds enhancements
to an app at startup from an external assembly. For example, an
external library can use a hosting startup implementation to provide
additional configuration providers or services to an app.
IIS modules with ASP.NET Core - you may still be able to inject your module in case you run the app on IIS. Add a web.config manually into the root directory and configure your module in there.

Swagger page is blank

I am running this .net core 3.1 api project and i got swashbuckle installed and configured swagger on the startup. However when i navigate to http://localhost:5000/swagger/index.html the page is totally empty. Can someone advise how to properly configure the project?

ASP.NET Core SPA Vue Template vs Vue CLI

I'm starting to learn about Single Page Aplications (SPA) and I was left with several doubts, although I searched a lot.
Let's consider a SPA application with Vue and a Web API application (ASP.NET Core), both on different servers.
1. Why would I use an ASP.NET Core Vue template if I can generate a pure Vue project with Vue CLI??
2. Is there any advantage in using the client made from an ASP.NET Core Vue template on the purely Vue client? The same goes for React and Angular?
If by "on different servers" you mean that the Vue application is hosted on a different server than your API, then I don't believe there is any advantage that you'd have by using the Visual Studio templates. The templates are designed to contain the two projects (client-side and API) into one, so that the development and deployment of both can be done together.
So if you're planning on deploying your .NET API and Vue application to different servers, then you'd probably leave the SPA configuration out of your .NET app, hence no need for the template.

Swashbuckle-Swagger documentation for routes made via Config.MapRoute during startup?

During startup of my .NET Core 2.0 web API, I register routes to my controllers via the MapRoute() method. I would like swagger to recognize these routes or allow me to add them during startup. I know the documentation indicates swagger does not support conventional routing out of the box (only attribute based routing), but does anyone have any alternatives to providing documentation for routes created dynamically during startup?
I have created Swashbuckle.AspNetCore.SwaggerGen.ConventionalRouting which replaces the original Swagger generator with a custom one that recognizes conventional routes. It supports ASP.NET Core 2.1 and ASP.NET Core 3.X applications. I have used it in a production application with more than 400 dynamic conventional routes (custom constraints, regexes, etc) and the results are pretty good.