2

I want to implement a limited time period membership in asp.net MVC. For that, I manually introduced a new column ExpiryDate in the AspNetUsers table. When a new user registers itself this field will automatically generate an expiry date with the help of the getdate() method.

CREATE TABLE [dbo].[AspNetUsers] (
[Id]                   NVARCHAR (128) NOT NULL,
[Email]                NVARCHAR (256) NULL,
[EmailConfirmed]       BIT            NOT NULL,
[PasswordHash]         NVARCHAR (MAX) NULL,
[SecurityStamp]        NVARCHAR (MAX) NULL,
[PhoneNumber]          NVARCHAR (MAX) NULL,
[PhoneNumberConfirmed] BIT            NOT NULL,
[TwoFactorEnabled]     BIT            NOT NULL,
[LockoutEndDateUtc]    DATETIME       NULL,
[LockoutEnabled]       BIT            NOT NULL,
[AccessFailedCount]    INT            NOT NULL,
[UserName]             NVARCHAR (256) NOT NULL,
[RegisterDate ]        DATETIME       DEFAULT (getdate()) NULL,
[ExpiryDate]           DATETIME       DEFAULT (getdate()+(60)) NULL,
CONSTRAINT [PK_dbo.AspNetUsers] PRIMARY KEY CLUSTERED ([Id] ASC)
);

Now, I want to check that expiry date value everytime when that user tries to login. Where and what logic should I implement in my code?

User42
  • 970
  • 1
  • 16
  • 27
Paramveer
  • 15
  • 1
  • 4
  • Posible Duplicate Question http://stackoverflow.com/questions/19460386/how-can-i-change-the-table-names-when-using-visual-studio-2013-aspnet-identity – ger Nov 19 '16 at 01:27

0 Answers0