Base solution for your next web application

Activities of "kfrancis"

Here you go:

URL: (POST) /api/services/app/Notification/SetNotificationAsRead
Hostname: WN0LDWK0002LC
Status Code: 500
Type: System.ComponentModel.Win32Exception
Message: The wait operation timed out.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
 ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
 ---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
   at Task<DbDataReader> Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)+(Task<SqlDataReader> result) => { }
   at void System.Threading.Tasks.ContinuationResultTaskFromResultTask<TAntecedentResult, TResult>.InnerInvoke()
   at async Task<RelationalDataReader> Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) x 2
   at async Task Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
ClientConnectionId:b2d68fed-75a2-4bbf-bd45-59f0926d7ecc
Error Number:-2,State:0,Class:11
ClientConnectionId before routing:0de1682f-2deb-4900-b43c-041492f0523b
Routing Destination:b42514b928c6.HS1.tr2061.canadacentral1-a.worker.database.windows.net,11011
   --- End of inner exception stack trace ---
   at async Task Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   at async Task Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   at async Task<int> Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable<ModificationCommandBatch> commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) x 3
   at async Task<int> Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList<IUpdateEntry> entriesToSave, CancellationToken cancellationToken) x 2
   at async Task<TResult> Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync<TState, TResult>(TState state, Func<DbContext, TState, CancellationToken, Task<TResult>> operation, Func<DbContext, TState, CancellationToken, Task<ExecutionResult<TResult>>> verifySucceeded, CancellationToken cancellationToken)
   at async Task<int> Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken) x 2
   at async Task<int> Abp.EntityFrameworkCore.AbpDbContext.SaveChangesAsync(CancellationToken cancellationToken)
   at async Task<int> Abp.Zero.EntityFrameworkCore.AbpZeroCommonDbContext<TRole, TUser, TSelf>.SaveChangesAsync(CancellationToken cancellationToken)
   at async Task Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesAsync()
   at async Task Abp.Notifications.NotificationStore.UpdateUserNotificationStateAsync(int? tenantId, Guid userNotificationId, UserNotificationState state)+(?) => { }
   at async Task Abp.Domain.Uow.UnitOfWorkManagerExtensions.WithUnitOfWorkAsync(IUnitOfWorkManager manager, Func<Task> action, UnitOfWorkOptions options)
   at async Task Abp.Notifications.NotificationStore.UpdateUserNotificationStateAsync(int? tenantId, Guid userNotificationId, UserNotificationState state)
   at async Task<SetNotificationAsReadOutput> PatientManagement.Notifications.NotificationAppService.SetNotificationAsRead(EntityDto<Guid> input) in C:/Users/vtoll/source/repos/PatientManagement/src/PatientManagement.Application/Notifications/NotificationAppService.cs:line 378
   at object lambda_method22956(Closure, object)
   at async ValueTask<IActionResult> Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
   at async Task Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()+Logged(?)
   at async Task Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()+Awaited(?)
   at void Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Task Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
   at async Task Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()+Awaited(?)
   at async Task Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextExceptionFilterAsync()+Awaited(?)

Also, on our Azure instance - it's created a new index.

The thing is, while we have been using notifications - it's not the kind of notification that a user would want to see in the notifications area, it's more just temporary based on retrieving from a slow API that they are doing that is taking a very long time. There's no need to show it in the "inbox" as it doesn't matter once it's completed.

If you look here, you're translating a server "event" into a client-side using an IIFE- but obviously, that won't work in the context of a background job:

script.AppendLine("(function(){");
            script.AppendLine("    abp.event.trigger('abp.dynamicScriptsInitialized');");
            script.Append("})();");

So, page.js is bundled but from what? I'm not sure I have anything but the pre-bundled file here.

Didn't touch anything, straight from the download. I suspect that the mac I'm using is unhappy, I'm just reformatting it to see if that changes anything.

It's too bad that demo is quite outdated. I'll dig in, though any assistance would be helpful.

Hmm, this sort of thing works if I apply it directly to the action method in question - but I can't seem to place this generally so that I don't need to markup everything to fix this:

public class LocalizationPipeline
{
    public void Configure(IApplicationBuilder applicationBuilder)
    {
        var supportedCultures = new[]
        {
            new CultureInfo("en-US"),
            new CultureInfo("fr")
        };

        var options = new RequestLocalizationOptions
        {
            DefaultRequestCulture = new RequestCulture(
                                       culture: "en-US",
                                       uiCulture: "en-US"),
            SupportedCultures = supportedCultures,
            SupportedUICultures = supportedCultures
        };
        options.RequestCultureProviders = new[]
            { new RouteDataRequestCultureProvider() {
            Options = options } };

        applicationBuilder.UseRequestLocalization(options);
    }
}

/// <summary>
/// Load Modal when segment is clicked on.
/// </summary>
/// <param name="model">The Segment View Model from the ajax call</param>
/// <returns></returns>
[MiddlewareFilter(typeof(LocalizationPipeline))]
public async Task<PartialViewResult> ViewSegmentModal(SegmentModalViewModel model)
{
    // some work
}

In our solution, we're only supporting english and french (ontario standard).

I sort of understand though I'm surprised that localization would have an effect in model binding. Is that expected? Is there any documentation about that effect?

Hmm, what does this look like actually? Same problem, different oauth provider (of my own writing):

I do know that I'll have to do something here to Request.Host to stop grabbing the subdomain since the provider only passes the callback path.

https://github.com/Clinical-Support-Systems/oneid-oauth-middleware/blob/9ece0e71be0a70371f9d0de78ae8144ec00f502e/src/AspNet.Security.OAuth.OneID/OneIdAuthenticationHandler.cs#L398

Perhaps something like this:

Uri request = new Uri("http://subdomain.domain.co.uk");
string host = request.Host;
string hostWithoutPrefix = null;

var tlds = new List<string>()
{
    //the second- and third-level TLDs you expect go here, set to null if working with single-level TLDs only
    "co.uk"
};

if (tlds != null)
{
    foreach (var tld in tlds)
    {
        Regex regex = new Regex($"(?<=\\.|)\\w+\\.{tld}$");
        Match match = regex.Match(host);


        if (match.Success)
            hostWithoutPrefix = match.Groups[0].Value;
    }
}

//second/third levels not provided or not found -- try single-level
if (string.IsNullOrWhiteSpace(hostWithoutPrefix))
{
    Regex regex = new Regex("(?<=\\.|)\\w+\\.\\w+$");
    Match match = regex.Match(host);


    if (match.Success)
        hostWithoutPrefix = match.Groups[0].Value;
}

But, do you know of a code example of including this in the query string and/or state so that I can redirect back to the right tenancy (with subdomain)?

Actually, it does appear possible to do without doing that by resolving services at runtime:

var patientAppServiceType = Type.GetType("PatientManagement.Patients.PatientsAppService, PatientManagement.Application");
var patientAppService = _iocManager.IocContainer.Resolve(patientAppServiceType) as IPatientsAppService;
var result = AsyncHelper.RunSync(() => patientAppService.GetPatientForViewAsync(patientId));

We have now been able to circumvent Telerik's inability to use their report designer on netstandard/netcore projects. I have a version based off the demo that I can share as well.

I don't know how to reproduce this. All we do to reproduce is build, then make any change whatsoever to any .cshtml file and try and browse the site - 100% fail.

I was able to work around this by simply updating Microsoft.CodeAnalysis.Common from 3.6.0 to 3.7.0-3.final.

Showing 1 to 10 of 17 entries