Base solution for your next web application
Open Closed

Non existing classes in step-by-steptutorial #10182


User avatar
0
bartkoolhaas created

Hi, In the step-by-step tutorial, "Creating PhoneBook Component"/"Creating Person Application Service, the PersonAppService class inherits the classes PhoneBookDemoAppServiceBase and IPersonAppService. Both have not been created in the tutorial.....

Should these be GetPeopleInput and PersonListDto instead? These have been created in the steps before?

public class PersonAppService : PhoneBookDemoAppServiceBase, IPersonAppService { private readonly IRepository<Person> _personRepository;

public PersonAppService(IRepository&lt;Person&gt; personRepository)
{
    _personRepository = personRepository;
}

public ListResultDto&lt;PersonListDto&gt; GetPeople(GetPeopleInput input)
{
    var people = _personRepository
        .GetAll()
        .WhereIf(
            !input.Filter.IsNullOrEmpty(),
            p => p.Name.Contains(input.Filter) ||
                 p.Surname.Contains(input.Filter) ||
                 p.EmailAddress.Contains(input.Filter)
        )
        .OrderBy(p => p.Name)
        .ThenBy(p => p.Surname)
        .ToList();

    return new ListResultDto&lt;PersonListDto&gt;(ObjectMapper.Map&lt;List&lt;PersonListDto&gt;>(people));
}

}


10 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @bartkoolhaas https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Developing-Step-By-Step-Core-Creating-Person-Application-Service has IPersonAppService


    PhoneBookDemoAppServiceBase is a class that all zero project has. You can check your own one. It has following naming pattern: [YOURAPPNAME]AppServiceBase see https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/AbpZeroTemplateAppServiceBase.cs

  • User Avatar
    0
    bartkoolhaas created

    Aaaaaahhh, apologies, i did do this. Visual Studio says "The type or namespace name 'IPersonAppService' could not be found, and it then gives me 3 options "Generate interface 'IPersonAppService' in new file, Generate interface 'IPersonAppService', or Generate new type... What should I do here?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bartkoolhaas,

    Did you manually create the interface on Application.Shared project ? If so, Visual Studio shouldn't complain about it.

    Thanks,

  • User Avatar
    0
    bartkoolhaas created

    I did... Maybe not correctly?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It seems like the interface is in the correct location. This might be related to error in CustomDtoMapper class. Can you build the solution when you fix the problem in CustomDtoMapper class ?

    Thanks,

  • User Avatar
    0
    bartkoolhaas created

    I fixed those, it still cannot find the respective classes...

    The errors it gives are as follows:

    Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'PhoneBookDemoAppServiceBase' could not be found (are you missing a using directive or an assembly reference?) Acme.PhonebookDemo.Application C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\PhoneBook\PersonAppService.cs 16 Active Error CS0246 The type or namespace name 'IPersonAppService' could not be found (are you missing a using directive or an assembly reference?) Acme.PhonebookDemo.Application C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\PhoneBook\PersonAppService.cs 16 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Application.dll' could not be found Acme.PhonebookDemo.Test.Base C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\test\Acme.PhonebookDemo.Test.Base\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Application.dll' could not be found Acme.PhonebookDemo.Web.Core C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Web.Core\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Application.dll' could not be found Acme.PhonebookDemo.GraphQL.Tests C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\test\Acme.PhonebookDemo.GraphQL.Tests\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\test\Acme.PhonebookDemo.Test.Base\bin\Debug\net5.0\ref\Acme.PhonebookDemo.GraphQL.Test.Base.dll' could not be found Acme.PhonebookDemo.GraphQL.Tests C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\test\Acme.PhonebookDemo.GraphQL.Tests\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Application.dll' could not be found Acme.PhonebookDemo.Tests C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\test\Acme.PhonebookDemo.Tests\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\test\Acme.PhonebookDemo.Test.Base\bin\Debug\net5.0\ref\Acme.PhonebookDemo.GraphQL.Test.Base.dll' could not be found Acme.PhonebookDemo.Tests C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\test\Acme.PhonebookDemo.Tests\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Application.dll' could not be found Acme.PhonebookDemo.Web.Host C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Web.Host\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Web.Core\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Web.Core.dll' could not be found Acme.PhonebookDemo.Web.Host C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Web.Host\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Application.dll' could not be found Acme.PhonebookDemo.Web.Public C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Web.Public\CSC 1 Active Error CS0006 Metadata file 'C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Web.Core\bin\Debug\net5.0\ref\Acme.PhonebookDemo.Web.Core.dll' could not be found Acme.PhonebookDemo.Web.Public C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Web.Public\CSC 1 Active Error CS0305 Using the generic type 'ObjectMapper<TSource, TDestination>' requires 2 type arguments Acme.PhonebookDemo.Application C:\Users\Bart Koolhaas\Documents\Visual Studio Projects\PhoneBookDemo\aspnet-core\src\Acme.PhonebookDemo.Application\PhoneBook\PersonAppService.cs 40 Active

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bartkoolhaas

    Could you send your project via email to [email protected] ? We can assist you via email and can fix the problem faster in that way.

    Thanks,

  • User Avatar
    0
    bartkoolhaas created

    The entire project? Thats quite a large file.... I'll do my best!

  • User Avatar
    0
    bartkoolhaas created

    Even zipped thats 250mb....

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bartkoolhaas

    You can delete the bin & obj folders and also node_modules folder. If you are working on Windows you can run Delete-BIN-OBJ-Folders.bat and manually delete node_modules folder.