Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add the relevant fields to the database record User e.g. Postcode.
  2. Declare

    a class (e.g. NewUser) which inherits from User in the client code.Declare

    an interface (e.g. INewUser) containing any number of the base type fields plus Postcode.

    Code Block
    languagec#
    public interface INewUser
    {
    	string Email { get; set; }
    	string Postcode { get; set; }
    }
  3. Declare a class (e.g. NewUser) which inherits from User in the client code and attach it to NewUser

    , so the top line would be

    :

    Code Block
    languagec#
    public class NewUser : User, INewUser
    {
    	public string Postcode { get; set; }
    }

     

  4. All Users retrieved from calls to the Data API will now contain the Postcode field in the underlying type, which will also implement INewUser.  To get the postcode of the current user, do this:

    Code Block
    languagec#
    var postcode = ((INewUser)LyniconSecurityManager.Current.User).Postcode;