Base solution for your next web application

Activities of "jseger"

Answer

I cannot get v3.0 to work either.

I've installed VS2017 -version 15.3.5.
I've installed .net core 2.0 SDK and Runtime.

It appears that any references that are .net core are having problems loading. System.Data.Common System.Runtime.Serialization.Formatters System.Runtime.Serialization.Primitives System.Security.Claims System.Xml.Path System.Xml.XmlDocument

I'm wondering if Tenant ID is necessary on child objects AND if omitting can improve performance.

Let's say I have an Order which has a child list of Order Items. An Order obviously has a tenant id. But an Order Item cannot exist without an order, so does it need a tenant id? Probably not, but is there any risk omitting it? Is there any advantage omitting it? Any thoughts at all?

Answer

Thanks. I will continue to do some tests. Maybe it will be clearer for me or at least I'll have more specific questions. I'll also play with the EventCloud source for a while.

My goal was to find out if I was missing anything obvious or if someone ran into the same issue as me.

Answer

Thanks! The article was somewhat helpful. However, I do think this is an Abp issue or at least I need further help understanding what it is doing.

The article talks about converting to and from local time. Basically, I don't want to convert. When I send a date to the server, that's date what I want to store. But it seems like Abp adjusts if for me when it maps my Dtos.

Cinco de Mayo is always May 5th. Christmas is always on December 25th. New Years is always January 1st.

Answer

That's not quite right.

Let's say I save a UTC date time as July 1, 2017 0:00 Z. This is the DAY the event is happening. July 1st.

Now when someone 1 hour west of me opens the event, it says that it is happening June 30th.

Question

I'm a little confused on how I should approach this.

Let's say I have an event that always happens on Sunday. The user makes a request to get the date of the next event. The server calculates the date by getting the date of next Sunday. The date even comes back to the client correctly. However, the angular date filter converts it to local time, which for me is Saturday.

This brings up another question. Let's say I am creating a time entry in my local time zone and I'm trying to communicate when the entry was actually created in my local time zone. In other words, I want them to know the event happened at 7:00 AM my time.

What is the best way to handle date times?

Nevermind..... forgot to inherit IApplicationService.

Ok great. I'm running into an angular injection error.

I named my service IContentNotificationAppService. I tried to inject 'abp.services.app.contentNotification'. It complains that it cannot find 'abp.services.app.contentNotificationProvider'.

Is this due to some convention?

BTW, my managers might be in parent organizations. So I need to go up the tree first. Is this a good way to do it?

var org = await _organizations.GetAsync(header.OrganizationUnitId); // go up the organization tree while(org.Parent != null) { org = org.Parent; } // now that we're on the top, get the users var users = await _userManager.GetUsersInOrganizationUnit(org, true);

***************************** [EDIT] *********************************** This is not the correct way to get managers of an organization. Obviously, it will get ALL the users within the tenant!!

This works though. I will probably make this an extension method since I frequently need to find managers within parent organizations.

List<User> users = new List<User>();

            // go up the organization tree
            do {
                var ous = await _userManager.GetUsersInOrganizationUnit(org, false);
                users.AddRange(ous);
                org = org.Parent;
            }
            while (org != null);

This is what I'm thinking.... I haven't tried it yet. I'm about to. I created another AppService called ContentNotificationAppService. I'll call this on the client after a successful content creation. Is this the right direction? Rather than injecting some notification service in my ContentAppService?? Below is the method from ContentNoficationAppService.

public async Task ContentSubmitted(EntityDto<Guid> input) { var content = await _contents.GetAsync(input.Id); var org = await _organizations.GetAsync(content.OrganizationUnitId);

        var users = await _userManager.GetUsersInOrganizationUnit(org, false);
        var currentUser = await _userManager.GetUserByIdAsync(AbpSession.GetUserId());

        List&lt;UserIdentifier&gt; userIds = new List&lt;UserIdentifier&gt;();

        foreach(var user in users) {
            if(user.Id == currentUser.Id) {
                // we don't need to send a notification to ourselves
                continue;
            }

            // we need to see if this is a manager within our organization
            bool isManager = await _userManager.IsGrantedAsync(user.Id, AppPermissions.Pages_Content_ManageContent);
            bool isSubscribed = await _notificationSubcriptionManager.IsSubscribedAsync(user.ToUserIdentifier(), ContentAppNotificationNames.ContentSubmitted);

            if(isManager && isSubscribed) {
                userIds.Add(user.ToUserIdentifier());
            }
        }

        if (userIds.Count > 0) {
            // send the notification to the users
            await _notificationPublisher.PublishAsync(
                ContentAppNotificationNames.ContentSubmitted,
                data: new MessageNotificationData($"{currentUser.FullName} has submitted some content."),
                userIds: userIds.ToArray());
        }
    }
Showing 21 to 30 of 32 entries