public async Task <UserProfileEntity> GetUserProfileById(IOperation operation, int id) { var entity = await userDataStore.GetProfileById(operation, id); if (entity == null) { throw CommonExceptions.UserWasNotFound(operation, id); } if (entity.UserRoleId != null) { entity.UserRole = await userRoleStore.GetUserRoleById(operation, entity.UserRoleId.Value); } return(entity); }