locked
User-scoped server-based variables RRS feed

  • Question

  • Hi all,

    For an HTML Client based app, if I want to pick up a value that is associated with a specific user during server-based operations, but I don't want to make a database call every time I want to retrieve it, what is an efficient method of doing so?

    Implication being that for every logged on user, this value is unique and must only and always be associated with the user making that particular call.

    Cheers,

    Ian


    Ian Mac

    Tuesday, June 24, 2014 10:39 AM

All replies

  • For a classic asp.net project, I would say extend the sql profile provider with your additional properties.

    In LightSwitch the FullName property of the user object, is handled that way, but I'm not sure if LightSwitch likes extending the profile provider.


    paul van bladel

    Tuesday, June 24, 2014 10:52 AM
  • Hi Paul,

    Well the specifics of what I'm looking at are that I want to obtain the user's Tenant ID (I already have a relationship from a 'Tenant' table to UserRegistration), a value which, since I'm using a shared database for multi-tenancy, needs to be applied to every filtering and CRUD operation.

    Obviously I'd rather not be calling to the database to get this value for every call, but since effectively the LightSwitch server-side is basically an asp.net application I'm unsure regarding 'state' management.

    Ideally I'm looking for a solution where upon session start, this value is retrieved ONCE based on the user relationship I've set up then subsequently referred to. Obviously I appreciate the disconnect between calls, hence my comment regarding state.

    I'm directly using the SecurityData service, which doesn't surface Profile 'entities' as far as I can make out.

    Ian


    Ian Mac

    Tuesday, June 24, 2014 11:59 AM
  • Hi Ian,

    Ok, I see. In that scenario the profile provider would not be an option I think.

    Sorry, wrong direction.


    paul van bladel

    Tuesday, June 24, 2014 2:07 PM