Base solution for your next web application

Activities of "blewis"

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

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());

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!

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

The Zero Template comes with the _layout.cshtml file containing a hardcoded page title (title tag). Is there an easy/built-in way to make the name of the active menu/nav item the page title? I have looked through the docs and I don't see anything.

I think this issue came up because of the time difference between when the general packages were updated and the release of Zero 4.1. I just downloaded 4.1.1 from the web site but haven't been able to try it yet. I will let you know.

Bryan

If I want to completely disable the chat function from a particular app that I'm building, is it best to remove the FEATURE_SIGNALR compilation symbol from the project? I just want to ensure that the SignalR/Chat related code doesn't load/add overhead when it's not going to be used at all.

Thanks, Bryan

This is my first ADP project -- we just bought Zero. I downloaded version 4.0.0 and I'm starting a new Asp.Net CORE & jQuery MPA project. When I first load it into VS2017, it compiles and runs. Then I do a NuGet package update, which involves about 45 packages across all of the projects (including many ADP packages). After the update, I get multiple errors:

Error CS1061 'IServiceCollection' does not contain a definition for 'AddAbpIdentity' and no extension method 'AddAbpIdentity' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) NweaCore.Web.Mvc ...\src\NweaCore.Web.Mvc\Startup\Startup.cs 49 Active

Error CS0516 Constructor 'PermissionChecker.PermissionChecker(UserManager)' cannot call itself NweaCore.Core ...\src\NweaCore.Core\Authorization\PermissionChecker.cs 14 Active

For the first error, I can make it go away by changing services.AddAbpIdentity<Tenant, User, Role, SecurityStampValidator>(options => to services.AddAbpIdentity<Tenant, User, Role>(options =>

But I cannot fix the second error no matter what and I cannot compile the solution. Any pointers? Sorry, I am new to the source at this point. Is it typical for errors to crop up when updating ADP packages?

This is a fresh copy of the code, I haven't made any changes at all other than package updates.

Thanks, Bryan

Showing 21 to 30 of 36 entries