PontiacGTX
PontiacGTX
CC#
Created by PontiacGTX on 5/16/2024 in #help
Blazor sends wrong index to the event
and when I send the object rather the index it says it is out of the bounds
2 replies
CC#
Created by abc on 11/14/2023 in #help
Blazor JS Interop - Bootstrap 5 Tooltip
if nothign or an error maybe the order the scripts are included matter
12 replies
CC#
Created by abc on 11/14/2023 in #help
Blazor JS Interop - Bootstrap 5 Tooltip
what does it show when you print console.log(new bootstrap(element,{}))
12 replies
CC#
Created by PontiacGTX on 9/22/2023 in #help
❔ trying to consume signalr through gateway
there is no identity or claims as of now
8 replies
CC#
Created by PontiacGTX on 9/22/2023 in #help
❔ trying to consume signalr through gateway
my hub is defined like
public class DriversHub:Hub
{
private IDriversServices _driversServices;
private ILogger<DriversHub> _logger;

public DriversHub(IDriversServices driversServices, ILogger<DriversHub> logger)
{
_driversServices = driversServices;
_logger = logger;
}

public override async Task OnConnectedAsync()
{
var userName = Context.User?.Claims.FirstOrDefault(x => x.Type == "email")?.Value;

if (!string.IsNullOrEmpty(userName))
await Groups.AddToGroupAsync(Context.ConnectionId, userName);

await base.OnConnectedAsync();
}

public async Task GetDriversDetail(string number)
{

var model = new Data.Model.GetDriverInformationModel { Number = number};
try
{
DriverInfo info = new DriverInfo();
info = (await _driversServices.GetDriverInformation(model)).ToList();
await Clients.Users(number).SendAsync("OnGetDriverDetails"/*, dest*/, Factory.OkResponse(info));
}
catch (Exception ex)
{
_logger.LogException(ex, model);
}

}
}
public class DriversHub:Hub
{
private IDriversServices _driversServices;
private ILogger<DriversHub> _logger;

public DriversHub(IDriversServices driversServices, ILogger<DriversHub> logger)
{
_driversServices = driversServices;
_logger = logger;
}

public override async Task OnConnectedAsync()
{
var userName = Context.User?.Claims.FirstOrDefault(x => x.Type == "email")?.Value;

if (!string.IsNullOrEmpty(userName))
await Groups.AddToGroupAsync(Context.ConnectionId, userName);

await base.OnConnectedAsync();
}

public async Task GetDriversDetail(string number)
{

var model = new Data.Model.GetDriverInformationModel { Number = number};
try
{
DriverInfo info = new DriverInfo();
info = (await _driversServices.GetDriverInformation(model)).ToList();
await Clients.Users(number).SendAsync("OnGetDriverDetails"/*, dest*/, Factory.OkResponse(info));
}
catch (Exception ex)
{
_logger.LogException(ex, model);
}

}
}
what am I doing wrong?
8 replies
CC#
Created by PontiacGTX on 9/22/2023 in #help
❔ trying to consume signalr through gateway
my api has
app.MapControllers();
app.MapHub<DriversHub>("/DriversHub");
app.MapControllers();
app.MapHub<DriversHub>("/DriversHub");
8 replies
CC#
Created by PontiacGTX on 9/22/2023 in #help
❔ trying to consume signalr through gateway
my Gateway has
await app.UseOcelot(configuration);
app.UseWebSockets();
await app.UseOcelot(configuration);
app.UseWebSockets();
on program.cs
8 replies
CC#
Created by PontiacGTX on 9/22/2023 in #help
❔ trying to consume signalr through gateway
an it is returning that it cannot stablish connection
Error establishing connection: Cannot start a HubConnection that is not in the 'Disconnected' state.
Error establishing connection: Cannot start a HubConnection that is not in the 'Disconnected' state.
8 replies
CC#
Created by PontiacGTX on 9/22/2023 in #help
❔ trying to consume signalr through gateway
hub: HubConnection | null = null;
constructor() {
this.onGetDriverCallBack = null;
this.hub = new signalR.HubConnectionBuilder().withUrl('http://localhost:7145/upgw/DriversHub').build();
this.hub.start();
console.log(this.hub);
this.hub.onreconnecting((error?: Error) => {
if (error) {
console.log(`Connection lost due to error: ${error.message.toString()}`);
}
});

this.hub.onreconnected(() => {
console.log('Connection reestablished');
});

this.hub.start().then(() => {
console.log('Connection established');
}).catch((error: Error) => {
console.log('Error establishing connection: ' + error.message);
});
}
hub: HubConnection | null = null;
constructor() {
this.onGetDriverCallBack = null;
this.hub = new signalR.HubConnectionBuilder().withUrl('http://localhost:7145/upgw/DriversHub').build();
this.hub.start();
console.log(this.hub);
this.hub.onreconnecting((error?: Error) => {
if (error) {
console.log(`Connection lost due to error: ${error.message.toString()}`);
}
});

this.hub.onreconnected(() => {
console.log('Connection reestablished');
});

this.hub.start().then(() => {
console.log('Connection established');
}).catch((error: Error) => {
console.log('Error establishing connection: ' + error.message);
});
}
8 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
let me join
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
ok
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
7
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
how do i assign the property into the config for serilog then?
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
makes sense
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
like this?
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
builder.Host.UseSerilog((context, configuration) => {

//configuration.ReadFrom.Configuration(context.Configuration);
configuration.WriteTo
.Console()
.MinimumLevel
.Information();
var fileName = "employeesLog-{Date}";
fileName = string.Concat(AppDomain.CurrentDomain.BaseDirectory, fileName, ".txt");


Log.Logger = configuration.WriteTo.File(fileName, rollingInterval: RollingInterval.Day).CreateLogger();
});
builder.Host.UseSerilog((context, configuration) => {

//configuration.ReadFrom.Configuration(context.Configuration);
configuration.WriteTo
.Console()
.MinimumLevel
.Information();
var fileName = "employeesLog-{Date}";
fileName = string.Concat(AppDomain.CurrentDomain.BaseDirectory, fileName, ".txt");


Log.Logger = configuration.WriteTo.File(fileName, rollingInterval: RollingInterval.Day).CreateLogger();
});
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
how do I place the Date on the file
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
in what case scenario do you need one?
174 replies
CC#
Created by PontiacGTX on 7/17/2023 in #help
✅ Serilog does not write logs to file
what kind of enricher do you need to make one your own
174 replies