IUserDefinition Interface

[namespace: Serenity, assembly: Serenity.Core]

Most applications store some common information about a user, like ID, display name (nick / fullname), email address etc. Serenity provides a basic interface to access this information in an application independent manner.

  1. public interface IUserDefinition
  2. {
  3. string Id { get; }
  4. string Username { get; }
  5. string DisplayName { get; }
  6. string Email { get; }
  7. Int16 IsActive { get; }
  8. }

Your application should provide a class that implements this interface, but not all of this information is required by Serenity itself. Id, Username and IsActive properties are minimum required.

Id can be an integer, string or GUID that uniquely identifies a user.

Username should be a unique username, but you can use e-mail addresses as username too.

IsActive should return 1 for active users, -1 for deleted users (if you don’t delete users from database), and 0 for temporarily disabled (account locked) users.

DisplayName and Email are optional and currently not used by Serenity itself, though your application may require them.