Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

[ProjectName]AppServiceBase class?? #1128


User avatar
0
alinm created

what is the use of this class - [MyProject]AppServiceBase ??

In my PersonAppService(inherits ApplicationService) i can query using linq like: var user_info = _userManager.Users.Where(a => a.Id == this.AbpSession.UserId).Select(b => b);

But in UserAppService(created by template and inherits ProjectNameAppServiceBase) i cannot query using linq. It does not allow this: _userManager.Users.Where.....

what is the solution???


2 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Base class injects UserManager as "UserManager" property. So, use

    UserManager.Users.Where...

    instead of

    _userManager.Users.Where..

    if you like _userManager, inject it into your service as you probably did for PersonAppService.

  • User Avatar
    0
    alinm created

    OK got it. i was missing System.Linq reference. Thanks!