Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "ivanosw1"

Hi, We are implementing a SignalR service that needs to write e read from database and is authenticated. There are some best practices to deal with database ? We are experiencing some "object disposed" exception accessing to database.

I've looked at your Chat module and I've seen then some time the UnitOfWork attribute is used but not always. Can you lead me on the correct way?

Thank you

Hi @ismcagdas, Yes, you're right. I think I've found a solution based on your comment. In the main code I've defined an attribute class the is applied on my signalr module. In startup class, through reflection, I can discover all classes with that attribute and register in the signalr routes.

It works and I think it could be part of aspnet zero without much effort. :-)

Thank you

Question

Hi, I've differents optional modules loaded as plugin (plugins directorty), Some of these has SignalR feature.

Every installation can have zero, one or all modules, so I can't register in advanced on startup class. How can I register on demand signalr routes like routes.MapHub<MyChatHub>("/signalr-myChatHub"); // Prefix with '/signalr'?

Thank you.

Answer

I think I've found the solution.

  1. Reference Quartz nuget package (3.0.7) in web host project
  2. Imports using Quartz.Impl;
  3. In Configure method of Startup.cs write app.UseCrystalQuartz(() => StdSchedulerFactory.GetDefaultScheduler().Result);
  4. Navigate on http://localhost:{yourport}/framework/quartz

Thansk to all for support

Answer

Thank @maliming.

The example use the "core" quartz implementation.

I'm using aspnet zero and I need to use IAbpQuartzConfiguration that has the scheduler instance used through the application. But the IAbpQuartzConfiguration is not available at startup time (in startup.cs in web host project).

So, how can I pass to app.UseCrystalQuartz(() the Scheduler used in aspnet Zero to view in the UI the triggers and jobs?

Thanks

Answer

Sorry @ismcagdas, my question isn't clear.

My problem is how obtain the "scheduler" instance on startup.

app.UseCrystalQuartz(() => scheduler)

I'm aware that the UI isn't for Angular.

Thank you.

Question

Hi, I wuold like to add the UI interface for Quartz. I'm using 7.1 version (Core + Angular).

This is the repository Crtystal Quartz UI

In the startup method who can I have a reference to the scheduler like explained in documentation ?

using CrystalQuartz.AspNetCore;
// ...
/*
 * app is IAppBuilder
 * scheduler is your IScheduler (local or remote)
 */
app.UseCrystalQuartz(() => scheduler); 

Can you help me? Thank you

I'm not an expert of Swagger and the default values works well for me until last update.

I must use options.CustomSchemaIds(o => o.FullName) because we have some duplicate schemaIds in our dtos otherwise I have the Conflicting schemaIds error.

If you want to see for enums the text instead of the values, I use options.DescribeAllEnumsAsStrings(); and all enum are showed as text:

Uno.Foundation.Core.ImageSizeTypestring $ref: #/definitions/Uno.Foundation.Core.ImageSizeType Enum: [ Big, Medium, Small ] <--- 1,2,3

Also swagger show a dropdown with literal values when you try some rest api. Maybe it is a duplicate functionality?

No, the code is the same and the problem happens in SwaggerOperationFilter.cs file.

Removed the new option all works fine. What is the purpose of this new code?

Thanks

Hi, I've upgraded from 6.9.1 to 7.1.0. The new option added to SwaggerGen in startup causes a duplicate key error: options.OperationFilter<SwaggerOperationFilter>();

System.ArgumentException: An item with the same key has already been added. Key: x-schema at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value) at Uno.Framework.Web.Swagger.SwaggerOperationFilter.Apply(Operation operation, OperationFilterContext context) in C:\Uno\Git\uno-ins\framework\src\Uno.Framework.Web.Core\Swagger\SwaggerOperationFilter.cs:line 32 at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateOperation(ApiDescription apiDescription, ISchemaRegistry schemaRegistry)...

Removed the new option all works fine. What is the purpose of this new code?

This is my full configuration for swagger:

services.AddSwaggerGen(options =>
                {
                    options.SwaggerDoc("v1", new Info { Title = "Framework API", Version = "v1" });
                    options.DocInclusionPredicate((docName, description) => true);
                    options.UseReferencedDefinitionsForEnums();
                    options.ParameterFilter<SwaggerEnumParameterFilter>();
                    options.SchemaFilter<SwaggerEnumSchemaFilter>();
                    options.OperationFilter<SwaggerOperationIdFilter>();
                    //SOFTWAREUNO - Questo filtro causa un errore di duplicazione di chiave
                    //options.OperationFilter<SwaggerOperationFilter>();
                    options.CustomDefaultSchemaIdSelector();

                    //Note: This is just for showing Authorize button on the UI. 
                    //Authorize button's behaviour is handled in wwwroot/swagger/ui/index.html
                    options.AddSecurityDefinition("Bearer", new BasicAuthScheme());

                    //SOFTWAREUNO
                    options.OrderActionsBy(o => o.RelativePath);
                    options.CustomSchemaIds(o => o.FullName);
                    foreach (var file in Directory.GetFiles(_hostingEnvironment.ContentRootPath, "*.docs.xml", SearchOption.AllDirectories))
                    {
                        options.IncludeXmlComments(file);
                    }
                    options.DescribeAllEnumsAsStrings();
                });

Thank you Ivano

Showing 41 to 50 of 178 entries