Base solution for your next web application

Activities of "blewis"

Sorry, ASP.NET Core & jQuery. (Zero version 4.1.1 -- just downloaded).

Thanks!

I have created a bunch of app services that inherit from AsyncCrudAppService, and everything works fine. However, when I am reviewing the Audit logs, the "Service" column for every call to GetAll() is "AsyncCrudAppService." I understand why, but it would be more useful if the log recorded my app service name, not the base service name. It makes it hard to keep track of things if all those calls are not differentiated. Just a suggestion.

Thanks, Bryan

Thanks!

Question

I am new to ABP and relatively new to AutoMapper, so I am a bit stumped about why some code is throwing an exception. I am trying to have one of my AppService methods return a Dto , but it throws an exception when I call ObjectMapper.Map().

The exception is : AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

But since the "schools" variable is an anonymous type, I can't setup a mapping configuration, right? The Dto is super simple, just one field. I could eliminate the use of AutoMapper, but I would like to be consistent and use it in all cases just like the existing AppServices.

namespace MyProject.Organizations.Dto
{
    public class SchoolSearchDto
    {
        public string DisplayName { get; set; }
    }
}

The AppService method:

public async Task<ListResultDto<SchoolSearchDto>> SchoolSearch(SchoolSearchInput input)
        {
            var query = from uou in _extendedOrganizationUnitRepository.GetAll()
                        where uou.DisplayName.Contains(input.SchoolName)
                        select new { uou.DisplayName, uou.ParentId };

            var schools = await query.WhereIf(input.ParentId != null, p => p.ParentId == input.ParentId).ToListAsync();

            return new ListResultDto<SchoolSearchDto>(
                ObjectMapper.Map<List<SchoolSearchDto>>(schools)
                );
        }

I also tried using this return statement:

return new ListResultDto<SchoolSearchDto>(
                schools.Select(school =>
                {
                    var dto = ObjectMapper.Map<SchoolSearchDto>(school.ou);
                    return dto;
                }).ToList());
Answer

Thanks. I used your first suggestion. I wasn't able to use the second approach because I had to add a reference to the parent OU in my query and it appears that there is no parent navigation property built into AbpOU, so I couldn't use Include().

Thanks again, Bryan

I have users across the United States and I need to display UTC dates that are stored in the DB in the user's local time. I understand all of the concepts of converting UTC times to local time within ASP.Net, but not within the ABP framework.

I am using the Asp.Net CORE MVC & jQuery project. Where should I be setting the clock provider to Utc? Startup.cs? After the provider is set, all I need to do is create a Abp.Timing.TimeZone setting for the tenant and/or user and my DB results from Entity Framework will be auto converted to the local timezone?

Thanks, Bryan

I will be deploying my project to Azure, which doesn't support SMTP. I have created a new EmailSenderSendGrid class that implements IEmailSender but uses the SendGrid API.

I then added:

IocManager.Register<IEmailSender, EmailSenderSendGrid>();

to the PostInitialize() method of my ProjectNameCoreModule.cs (in the Core project) in an attempt to register the new implementation. However, when I attempt to send an email from an MVC controller, it throws and exception and that exception is coming from Abp.MailKit.MailKitEmailSender. So that implies it's still trying to use MailKit and not my class. What am I doing wrong?

This is the first time I am trying to use the IocManager to register my own implementation...so perhaps I am screwing that up.

Thanks, Bryan

While I am doing some stuff server-side (not with Moment), I figured it out. However, I think you have a typo in your docs. On the page about Timing at <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Timing#DocTimeZones">https://aspnetboilerplate.com/Pages/Doc ... cTimeZones</a>, you state:

ABP assumes that value of timezone setting is a valid Windows timezone id.

When I attempted to use the numeric Windows Timezone ID as documented by MS at <a class="postlink" href="https://msdn.microsoft.com/en-us/library/gg154758.aspx">https://msdn.microsoft.com/en-us/library/gg154758.aspx</a>, it starting giving me errors. When I changed the Abp.Timing.TimeZone setting to the Timezone Name (e.g. "Pacific Standard Time") everything was fine.

Bryan

Thanks. This worked!

Showing 11 to 20 of 36 entries