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

Activities of "dmux"

Absolute legend. Great catch, thanks. That worked.

I regretted using People as the plural, and I'd forgotten how many things work on matching the names.

Anyway, that's got me past the big roadblock. Cheers.

I am trying to get started with the MAUI project so I can build out the mobile interface for my project. I have created a ProxyAppService which inherits from my AppService interface, but the DependencyResolver fails to resolve it in the razor.cs, throwing "No component for supporting the service DMux.WebPortal.Common.IPeopleAppService was found"

I tried putting builder.Services.AddSingleton<IPeopleAppService, ProxyPersonAppService>(); in the MauiProgram.cs but it made no difference.

My interface:

The Interface:

public interface IPeopleAppService : IApplicationService
    {
        Task < PagedResultDto < GetPersonForViewDto > > GetAll(GetAllPeopleInput input);

        Task < GetPersonForViewDto > GetPersonForView(int id);

        Task < GetPersonForEditOutput > GetPersonForEdit(EntityDto input);

        Task CreateOrEdit(CreateOrEditPersonDto input);

        Task Delete(EntityDto input);

        Task < FileDto > GetPeopleToExcel(GetAllPeopleForExcelInput input);

        Task < PagedResultDto < PersonUserLookupTableDto > > GetAllUserForLookupTable(GetAllForLookupTableInput input);
    }


The ProxyAppService:

public class ProxyPersonAppService : ProxyAppServiceBase, IPeopleAppService
    {
        public async Task CreateOrEdit(CreateOrEditPersonDto input)
        {
            await ApiClient.PostAsync(GetEndpoint(nameof(CreateOrEdit)), input);
        }

        public async Task Delete(EntityDto input)
        {
            await ApiClient.DeleteAsync(GetEndpoint(nameof(Delete)), input);
        }

        public async Task < PagedResultDto < GetPersonForViewDto > > GetAll(GetAllPeopleInput input)
        {
            return await ApiClient.GetAsync < PagedResultDto < GetPersonForViewDto > > (GetEndpoint(nameof(GetAll)), input);
        }

        public async Task < PagedResultDto<PersonUserLookupTableDto > >  GetAllUserForLookupTable(GetAllForLookupTableInput input)
        {
            return await ApiClient.GetAsync < PagedResultDto < PersonUserLookupTableDto > > (GetEndpoint(nameof(GetAllUserForLookupTable)), input);
        }

        public async Task < FileDto > GetPeopleToExcel(GetAllPeopleForExcelInput input)
        {
            return await ApiClient.GetAsync < FileDto > (GetEndpoint(nameof(GetPeopleToExcel)), input);
        }

        public async Task < GetPersonForEditOutput > GetPersonForEdit(EntityDto input)
        {
            return await ApiClient.GetAsync < GetPersonForEditOutput > (GetEndpoint(nameof(GetPersonForEdit)), input);
        }

        public async Task < GetPersonForViewDto > GetPersonForView(int id)
        {
            return await ApiClient.GetAsync < GetPersonForViewDto > (GetEndpoint(nameof(GetPersonForViewDto)), id);
        }
    }

I have tried starting from a brand new version 12 template. The only things I have added are the People data table (using PowerTools), and the configs required to get the project up and running. I'm happy to pack the whole project up and post it if required.

I had the same issue. The steps from @AuroraBMS worked for me.

Thanks very much @marble68, I've never bothered going under the bonnet before into the ABP code, and it's interesting!

In the end I stuck with what I've got available out of the box. In my background task I now have this:

List<int> tenants = _tenantRepository.GetAll()
                       .Where(t => !t.IsDeleted && t.IsActive)
                       .Select(t => t.Id)
                       .ToList();

foreach (int tenantId in tenants)
{
    using (var unitOfWork = _unitOfWorkManager.Begin())
    {
        using (_unitOfWorkManager.Current.SetTenantId(tenantId))
        {
            var users = _userRepository.GetAllList();
            foreach (var user in users)
            {
                _notificationStore.DeleteAllUserNotifications(user.ToUserIdentifier(), UserNotificationState.Read, Clock.Now.AddYears(-10), Clock.Now.AddDays(-7));
                _notificationStore.DeleteAllUserNotifications(user.ToUserIdentifier(), UserNotificationState.Unread, Clock.Now.AddYears(-10), Clock.Now.AddDays(-30));
            }
        }
        unitOfWork.Complete();
    }
}

<br> ... so I'm iterating through the tenancies, then the users in each tenancy, and for each user just calling the INotificationStore delete method with parameters. Raw SQL would be much more efficient, but this works great, and I do like to work through the framework where I can.

Thanks again for your ideas and help.

Hi @marble68, thanks for your suggestion!

I think you're right - DeleteAllUserNotifications() will be part of the solution. It even lets me specify a date range. Unfortunately it only allows me to operate on notifications for a single user at a time, though. So what I now need is a way to iterate over all the users, so I can run DeleteAllUserNotifications for each one.

I can't see a way to enumerate users. Is there an Abp function for this?

What I meant was if I could use IRepository<UserNotification>, I could just delete the records older than a certain date.

In IUserNotification I can see there is a delete function, but I have to specify a user. What I need to do is iterate over all the users and get all the notifications older than a certain time, then delete them. I guess if I could iterate over all users I could use IUserNotification to get all notifications and then delete the older ones.

Is there a way I can iterate over all users? Even just all users in one tenancy (because I can iterate through tenancies)?

My app has tens of thousands of old AbpUserNotifications and AbpTenantNotifications. I only need to keep them if they are less than a week old. I can't access repositories for those data tables, so what is the best way to delete old records in my background worker?

Hi @ismcahdas,

I'm not exactly sure what your question means. I don't think there is a way to make more than one language the default. English (UK) is set to default.

Anyway I finally solved it when I noticed the English (US) had the code "en". I changed it to have "en-us" and then disabled it in the host. Now the UK one is the only one enabled and is the default, and it's working in the tenant.

Thanks, Kevin

I recently upgraded my Core MVC project from 8.1 to 8.6, and it looks like everything is ok running in debug mode locally in Visual Studio, but when I push it up to Azure App Service (using my existing build pipeline) none of my localizations (in Core\Localization&lt;project>&lt;project>.xml) are working - menu items, column headings, everything has reverted to "[Property name]" format. Interestingly, this even includes new items added in the ASPNETZERO base project since 8.1 (See "Dynamic Parameters" and "Webhook Subscriptions"):

When I go to the Languages section on the Azure published 8.6 site I can see 900 entries, which appear to be the built-in ones:

On my existing live site (another Azure app), which is still v8.1, I see 1849 entries and all my localizations are working:

I see 1961 entries on my local debug version (V8.6 upgrade added quite a few), and they are all working:

Incidentally I have disabled all other languages so that English (UK) is the only enabled option. Is that relevant? It was like that before the upgrade as well.

Can someone tell me what might be going on?


Update:

When I enabled US English in the host, the localization suddenly worked in my tenant, even though the tenant still has UK English as the default.

This is now the setting:

... and now all my localizations work.

I'm still interested to learn what is happening. I don't want US English enabled because if a user selects it some of my date validations will not work correctly.

Hi,

I can see #6250 which addresses arrow functions in the MVC project causing IE11 compatibility issues. It looks like some more arrow functions have crept in since that time.

I am using ASP Core MVC Project v8.0.

I see the "EntityHistory" arrow functions (which the PR was fixing) all through the RAD-generated code. I found they were in the PartialTemplates.txt file so I have updated the template files and will test, but the RAD Tool probably should be updated for this

I am also getting a syntax error from IE for an arrow function in customizable-dashboard-libs.min.js (36,39):

        timer = setTimeout(() => {
            callBack();
        }, delay);
        

and chat.signalr.js (42,30):

      connection.start()
            .then(() => {
                reconnectTime = 5000;
                tries = 1;
            })
            

Please advise how to refactor these to not use arrow functions.

Showing 1 to 10 of 32 entries