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

Activities of "Ricavir"

Hi,

I'm using AppNotifier in several ways in my app. I send notifications directly to users and, in other cases, I send notifications to a tenant (then to all subscribed users).

The last case, sending notification to a tenant, is creating notification twice in database... but my code is only run once.

Here is the code in AppNotifier.cs :

public async Task SchedulerNewInvoiceForecastCreatedAsync(int? tenantId, int invoiceForecastCount)
        {
            var notificationData = new LocalizableMessageNotificationData(
                new LocalizableString(
                    "SchedulerNewInvoiceForecastCreatedNotificationMessage",
                    LogisavConsts.LocalizationSourceName
                    )
                );

            notificationData["invoiceForecastCount"] = invoiceForecastCount;

            await _notificationPublisher.PublishAsync(AppNotificationNames.SchedulerNewInvoiceForecastCreated, notificationData, severity: NotificationSeverity.Success, tenantIds: new[] { tenantId });
        }

Notifications that are created twice have just 1 second difference in their CreationTIme property : 2019-05-18 03:57:49.0409870 2019-05-18 03:58:03.4540753

As described in the begining, the same code sent to specific users is creating only one notification as expected.

Using Zero 5.5.1

Tks for your support

Hi,

Server : asp.net core Client : angular

I'm storing datetime properties with UTC timezone on database. On client side, timezone conversion works great.

My problem is on server side : I need to convert all datetime properties of an entity to the current tenant timezone. I've used refection to do that :

foreach (PropertyInfo property in entity.GetType().GetProperties().Where(p => p.PropertyType == typeof(DateTime?) || p.PropertyType == typeof(DateTime)))
{
    if (property.GetValue(entity) != null)
        property.SetValue(entity, _timeZoneConverter.Convert((property.GetValue(entity) as DateTime?).Value, tenantId));
}

When I run this code, all datetime properties are changed to local time as I want BUT stored in database at the end of UnitOfWork...

How can I do this conversion without changing datetime property values in database ?

PS : I know your existing example to export users but it doesn't fit my need

Hi,

I'm trying to extend "InternalServerError" translation that is in AbpWeb source. I've followed abp documentation : https://aspnetboilerplate.com/Pages/Documents/Localization#extending-localization-sources

I've added following line on LocalizationConfigurer class :

localizationConfiguration.Sources.Extensions.Add(new LocalizationSourceExtensionInfo("AbpWeb", new XmlEmbeddedFileLocalizationDictionaryProvider(Assembly.GetExecutingAssembly(), "Localization.AbpWeb")));

And added XML files on a dedicated folder :

The problem is that "InternalServerError" translation remains always the same after doing that.

Is there another thing to do to make it work ?

Hi,

I'm trying to download files with Xamarin App. Server side is ASPNET CORE version 5.1 (with Angular web client)

I've tried both solutions :

  1. Download from Flurl download method
  2. Download with CrossDownloadManager component (https://github.com/SimonSimCity/Xamarin-CrossDownloadManager)

As it is done on angular side, I send a request from Xamarin app to the server to store file on temporory folder. Then I send a request to FileController (DownloadTempFile method) to get the file.

I'm using this code to build url :

var url = ApiUrlConfig.BaseUrl + "File/DownloadTempFile?fileType=" + result.FileType + "&fileToken=" + result.FileToken + "&fileName=" + result.FileName;

When testing this, I'm able to download files from received HTTP response content but the file is not recognized by the system (tested on Android emulator) and can't be opened. When I try to download a basic image from an existing website url (or a pdf file), everything works like a charm. File is downloaded and can be opened...

Do you have any idea to fix that ?

Just another remark : tenancy is determined from subdomain on server side... but url doesn't mentioned it. I don't think that it is a problem as this request doesn't need to know about tenant.

Hi,

I would like to use the powershell script from the "build" folder. I'm publishing my app to Azure (App service) and I'm doing a lot of steps manually as for now :

  • clearing wwwroot folder over FTP
  • Publishing asp.net core from visualstudio publish UI
  • Bluilding angular app
  • Copying new files over FTP
  • Changing angular conf files manually according to the targetted slot (production or staging)
  • ....

I would like to automate all this process. As I'm using VSTS, I could also think of a full pipeline for continuous delivery...

I know that this is out of your support scope but could you guide me a little bit according to you experience ?

Hi,

I'm using some local translations on Xamarin App for some special cases where translations are available on server side. These local translations are linked to the device language... but, when user changes languages from app and gets translation from server, the local translations are kept on device language

Therefore, I can have a mix of server translation (let's say english ones) and local translations in the device language.

Is this a bugg ? How can I sync server and local translations ?

Tks

Hi,

I'm trying to sync some data from xamarin app to server. To do that, I'm listening to connectivity changes. If user is not connected and tries to save data, data is stored in cache.

Here is the code I'm using to sync data on xamarin app

public static class OfflineManager
    {        
        public static void ConnectivityChangedRegister()
        {
            CrossConnectivity.Current.ConnectivityChanged += async (sender, args) =>
            {
                if (args.IsConnected == true)
                {
                    await SyncOfflineEvents();
                }
            };
        }

        public static async Task SyncOfflineEvents()
        {
            if (Barrel.Current.Exists(CacheKeys.OfflineEvents))
            {
                var eventAppService = DependencyResolver.IocManager.Resolve<IEventAppService>();
                var offlineItemsToSync = Barrel.Current.Get<List<EventEditInput>>(CacheKeys.OfflineEvents);
                foreach (var offlineEvent in offlineItemsToSync)
                {
                    await WebRequestExecuter.Execute(
                        async () => await eventAppService.UpdateEventEdit(offlineEvent),
                        null,
                        null,
                        null,
                        false
                    );
                }
                Barrel.Current.Empty(CacheKeys.OfflineEvents);
            }
        }        

    }

It's a static class that I'm calling from App.xaml.cs like that : OfflineManager.ConnectivityChangedRegister();

When device becames connected and data is available to sync, the code runs correctly.

The issue is that I'm always getting a timeout exception for the first call (wich is a PUT).

I'm using WebRequestExecuter, thefore, when timeout exception is thrown a retry popup is displayed.

When I press "Ok" from this popup, the same call is sent to server correctly.

I think the problem occurs because the first call is not in a safe thread.

I've tried several things but always getting a timeout issue for the first call...

Can you please give me some support to avoid this timeout exception ?

Hi,

I'm facing an issue because of background worker culture (which is en-US by default). I would like to set it to tenant default language.

I already used CultureHelper class to convert a datetime value to the right format string.

But here, I need to set the whole thread of backgroundworker to the tenant culture.

I'm planning to use following code within DoWork method :

System.Threading.Thread.CurrentThread.CurrentCulture = ...

Is ABP framework providing an other way to do it ? Do I need to come back to the previous culture at the en of DoWork method process ?

Tks for you support

Hi,

I'm hosting my application (asp.net core + angular) on Azure App Service. I'm using SLOTS to publish my app.

First publish is made on SLOT stagging. On this stagging SLOT, I deactivate some features (like background workers) available on appsettings.production file. After validating that everything is working on stagging SLOT, I'm using Azure SWAP feature to switch application from stagging SLOT to production SLOT.

This works fine and it is a very nice feature.

The only problem is that I need to overwrite appsettings.production everytime I use this SWAP feature (in order to set everything up for production).

Do you know a way to avoid overwriting appsettings files after app is published ?

I'm wondering if the file appsettings.stagging (available on the startup template of aspnetzero) is here for that purpose...

Hi,

I'm developing a mobile app with zero xamarin template. I'm trying to get data from an appservice that works well... but on mobile app NullableIdDto<long> is mmissing from query parameter.

Here is the method that I'm calling :

Task<NoteEditOutput> GetNoteEdit(GetNoteInput input);

GetNoteInput :

public class GetNoteInput
    {
        public NullableIdDto<long> NullableId { get; set; }   
        public long? AddressId { get; set; }
        public long? OwnerId { get; set; }
        public long? OpportunityId { get; set; }
        public long? ContactId { get; set; }
        public long? SupplierId { get; set; } 
    }

Xamarin code is :

var input = new GetNoteInput();
    input.NullableId = new NullableIdDto<long>(note?.Id);    // Id = 91
    var noteFromServer = await _noteAppService.GetNoteEdit(input);
    Model = ObjectMapper.Map<NoteEditOutputModel>(noteFromServer);

This request results on following JSON object :

{ "input": { "nullableId": null, "addressId": null, "ownerId": null, "opportunityId": null, "contactId": null, "supplierId": null } }

Should be :

{ "input": { "nullableId": { "id": 91 }, "addressId": null, "ownerId": null, "opportunityId": null, "contactId": null, "supplierId": null } }

Is this linked with a Flurl configuration ? How can I fix that ?

Showing 41 to 50 of 93 entries