Base solution for your next web application

Activities of "soonjoo"

Hello team,

I have set up hangfire, and I can access the dashboard, however, how do I set up a recurring job so that it executes everyday at 12 midnight?

I have read the documentation and created a class which inherit BackgroundJob

public class DailyDataAggregatorJob : BackgroundJob<DailyDataAggregatorJobArgs>, ITransientDependency
    {
        public DailyDataAggregatorJob()
        {
        }

        [UnitOfWork]
        public override void Execute(DailyDataAggregatorJobArgs args)
        {
            Logger.Info("Inside DailyDataAggregatorJob");
        }
    }

however, where should I put the code the start this recurring job and tell them to execute it daily? according to the hangfire documentation I am supposed to add this line of code somewhere

RecurringJob.AddOrUpdate(() => Console.Write("Easy!"), Cron.Daily);

I have checked the abp documentation on background jobs but it doesn't demonstrate this.

thanks!

hello team,

after upgrading from v4 to v5, i am able to log in successfully, but after entering the main page i cannot click on anything, im not sure where to investigate or fix these issues.. it might be caused by the merging of the new code, any help to point me into the right direction is appreciated. here is the error:

free website to upload photos

thank you.

hello team,

For this new update of ANZ v5, I notice that the DTOs don't use attributes for auto mapping anymore.. instead, all are declared in CustomDtoMapper.

May I know the reason, and should we still continue using auto mapping via attributes or change all mapping definitions to follow your practise and declare inside CustomDtoMapper? Thank you.

Hello team,

I am very new to Xamarin and want to test it out on your framework. I am trying to create a simple page.. I managed to show out the link on the side menu, however clicking on the link does nothing. May I know which steps I have missed out?

First I added a new content page to in Mobile.Shared Views Folder

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Name="BarcodeSearchPage"
             x:Class="MyCompany.MyProject.Views.BarcodeSearchView"
             xmlns:behaviors="clr-namespace:MyCompany.MyProject.Behaviors;assembly=MyCompany.MyProject.Mobile.Shared"
             xmlns:base="clr-namespace:MyCompany.MyProject.ViewModels.Base;assembly=MyCompany.MyProject.Mobile.Shared"
             xmlns:controls="clr-namespace:MyCompany.MyProject.Controls;assembly=MyCompany.MyProject.Mobile.Shared"
             xmlns:image="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions"
             xmlns:extensions="clr-namespace:MyCompany.MyProject.Extensions.MarkupExtensions;assembly=MyCompany.MyProject.Mobile.Shared"
             xmlns:permission="clr-namespace:MyCompany.MyProject.Services.Permission;assembly=MyCompany.MyProject.Mobile.Shared"
             base:ViewManager.AutoWireViewModel="true" 
             Title="{Binding Title}">
    <ContentPage.Content>
        <StackLayout>
            <Label Text="Welcome to Xamarin.Forms!"
                VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand" />
        </StackLayout>
    </ContentPage.Content>

    <ContentPage.Behaviors>
        <behaviors:EventHandlerBehavior EventName="Appearing">
            <behaviors:InvokeCommandAction Command="{Binding PageAppearingCommand}" />
        </behaviors:EventHandlerBehavior>
    </ContentPage.Behaviors>
</ContentPage>


[XamlCompilation(XamlCompilationOptions.Compile)]
	public partial class BarcodeSearchView : ContentPage
	{
		public BarcodeSearchView ()
		{
			InitializeComponent ();
		}
	}

Then I added a new file in Mobile.Shared ViewModels Folder

public class BarcodeSearchViewModel : XamarinViewModel
    {
        public string Title => L.Localize("Barcode Search");

        public BarcodeSearchViewModel()
        {
        }
    }

Then I added a new Navigation Menu Item

private readonly ObservableRangeCollection<NavigationMenuItem> _menuItems = new ObservableRangeCollection<NavigationMenuItem>
        {
            new NavigationMenuItem
            {
                Title = L.Localize("Tenants"),
                Icon = "Tenants.png",
                ViewType = typeof(TenantsView),
                RequiredPermissionName = PermissionKey.Tenants,
            },
            new NavigationMenuItem
            {
                Title = L.Localize("Users"),
                Icon = "UserList.png",
                ViewType = typeof(UsersView),
                RequiredPermissionName = PermissionKey.Users,
            },
            new NavigationMenuItem
            {
                Title = "Search Barcodes",
                Icon = "UserList.png",
                ViewType = typeof(BarcodeSearchView),
            }
            
            /*This is a sample menu item to guide how to add a new item.
                ,new NavigationMenuItem
                {
                    Title = "Sample View",
                    Icon = "MyIcon.png",
                    TargetType = typeof(_SampleView),
                    Order = 10
                }
            */
        };

What steps did I miss out so I can navigate to my page? Thank you.

hello team,

I am having issue running the android app. using version 5.04 jquery + aspnet core. I connect my phone via wifi to debug. After the splash screen, I am prompted to log in. however, everything I do shows that returns the "A problem occurred while trying to communicate with the server. Do you want to try again?" error. Checking my database audit logs, the methods are called successfully without any exception. the call dies here:

in Application.Client.ApiClient.AbpApiClient

public async Task<T> GetAsync<T>(string endpoint, object queryParameters, string accessToken, bool stripAjaxResponseWrapper)
        {
            var httpResponse = GetClient(accessToken)
                .Request(endpoint)
                .SetQueryParams(queryParameters);

            if (stripAjaxResponseWrapper)
            {
                var response = await httpResponse.GetJsonAsync<AjaxResponse<T>>(); // < ------ DIES AFTER THIS LINE
                ValidateAbpResponse(response);
                return response.Result;
            }

            return await httpResponse.GetJsonAsync<T>();
        }

any help is much appreciated. Thank you.

Hello team,

I have a table that is similar to Organization Units, where there is a code column to store the sequence of the record. So for each record inserted under a root, it will be 00001.00001, 00001.00002, 00001.00003, 00001.00004 etc... however, if I call my insert API multiple times in quick succession, the code wont be sequential... meaning it will 00001.00001, 00001.00001, 00001.00001, 00001.00002 is there a way to control the concurrency on a table?

Thank you

Question

Hello team,

Currently for the User table, Surname and First name is required, what is the best way to change it to optional instead? also I would like to make full name required. I can only think of using the OnModelCreating, or is there another way to override the attributes?

Thank you.

Hello team,

I want to build some sort of tree view hierarchy structure, very similar to organization units. Was OrganizationUnits built with this in mind, as an example to other tree view hierarchy types of structure? Besides the copying the concepts of OU, what are the other stuff will I be able to reuse? Will I be able to reuse the OrganizationUnitManager and pass in my own entities?

Thank you

Hello team,

I have created a simple revision tracking for my entity. Whenever this type of entity is created, updated, or deleted, i will store a snapshot of the new values into a mirror of that entity table. When I create a new entity, the first time is successful. However, the second time I create the entity, I get an internal server error. My application did not break on the exception throw, I had to go to the logs to check the error. Basically the error says

System.InvalidOperationException: The connection does not support MultipleActiveResultSets.

Not really sure why the connection is still open..

Basically I had 2 pieces of code:

public class SampleRevisionHandlers :
        AgrinomeDomainServiceBase,
        IEventHandler<EntityCreatingEventData<Sample>>,
        IEventHandler<EntityUpdatingEventData<Sample>>,
        IEventHandler<EntityDeletingEventData<Sample>>,
        ITransientDependency
    {

        private readonly ISampleRevisionManager _sampleRevisionManager;

        public SampleRevisionHandlers(
            ISampleRevisionManager sampleRevisionManager)
        {
            _sampleRevisionManager = sampleRevisionManager;
        }

        public void HandleEvent(EntityCreatingEventData<Sample> eventData)
        {
            var sample = eventData.Entity;
            _sampleRevisionManager.CreateNewSampleRevision(sample, "CREATE");
        }

        public void HandleEvent(EntityUpdatingEventData<Sample> eventData)
        {
            var sample = eventData.Entity;
            _sampleRevisionManager.CreateNewSampleRevision(sample, "UPDATE");
        }

        public void HandleEvent(EntityDeletingEventData<Sample> eventData)
        {
            var sample = eventData.Entity;
            _sampleRevisionManager.CreateNewSampleRevision(sample, "DELETE");
        }
        
    }
public class SampleRevisionManager : DomainService, ISampleRevisionManager
    {

        private readonly IRepository<SampleRevision, long> _sampleRevisionRepository;

        public SampleRevisionManager(
            IRepository<SampleRevision, long> sampleRevisionRepository)
        {
            _sampleRevisionRepository = sampleRevisionRepository;
        }

        [UnitOfWork]
        public void CreateNewSampleRevision(Sample sample, string action)
        {
            var latestRevision = _sampleRevisionRepository.GetAll().OrderByDescending(e => e.Id).Where(e => e.SampleId == sample.Id).FirstOrDefault();
            long? latestRevisionId = null;
            if (latestRevision != null)
            {
                latestRevisionId = latestRevision.Id;
            }

            var sampleRevision = new SampleRevision(sample)
            {
                RevisionAction = action,
                PreviousRevisionId = latestRevisionId
            };

            sampleRevision = _sampleRevisionRepository.Insert(sampleRevision);
        }
    }

Any ideas why it would keep the connection open??

Thank you

Hello team,

After posting TokenAuth/Authenticate to log in, one of the returned parameters is userId, but it is always 0, is it supposed to be 0?

Thanks

Showing 1 to 10 of 21 entries