Base solution for your next web application

Activities of "joemo"

Ah ok - so I am missing something. I was hoping to use it to store that data for an amount of time and prevent frequent slow queries during that time, retrieving from cache instead. Therefore, I guess it is the AbsoluteExpireTime I should be using instead?

Anyone? I'll give you a chocolate biscuit

I'm an idiot, sorry. Can confirm that was all that was missing

If its the log4net file thats locking, I had the same problem. You can get around it by adding this line to log4net.config before the </appender> line:-

<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

Not quite what I meant.... What I mean is... when I've added an Entity with automatic audit fields (e.g. CreatorUserId, CreationTime, etc.) I can see how to access those fields in the app service and pass them through to the client.

But how do get the corresponding username for that userid? Do I need to access UserManager, and if so - how?

Answer

Well, for future civilizations, here's how I did it.

Added userRepository to the constructor in UserStore.cs:-

_userRepository = userRepository;

And added a function to retrieve the list asyncronously:

public async Task<List<User>> GetAllUsersAsync()
        {
            return await _userRepository.GetAllListAsync();
        }

Then you can get to it via an app service:-

public async Task<GetAllUsersOutput> GetAllUsers()
        {
            return new GetAllUsersOutput
            {
                Users = Mapper.Map<List<UserDto>>(await _userStore.GetAllUsersAsync())
            };
        }

And use angular...

vm.users = [];

            userService.getAllUsers().success(function (data) {
                vm.users = data.users;
            });

... to display it in a view:-

<select ng-model="vm.users.name" ng-options="user.id as user.name for user in vm.users">
                    <option value=""></option>
                </select>
Showing 1 to 6 of 6 entries