.net identityUser datetimeoffset mismatch postgresql

时间:2017-10-31 15:28:23

标签: postgresql asp.net-core asp.net-identity

我正在使用带有postgresql的dotnet核心,突然之间(我猜有更新的东西)它全部停止工作。 enter image description here

这是我的用户实体继承的实体。 这里的lockoutend是DateTimeOffset?在我的postgres表中:

  CREATE TABLE public.users
  (
    id integer NOT NULL DEFAULT nextval('users_id_seq'::regclass),
    accessfailedcount integer NOT NULL,
    concurrencystamp character varying(255) COLLATE pg_catalog."default",
    email character varying(128) COLLATE pg_catalog."default",
    emailconfirmed boolean NOT NULL,
    lockoutenabled boolean NOT NULL,
    lockoutend timestamp with time zone,
    name character varying(128) COLLATE pg_catalog."default",
    normalizedemail character varying(128) COLLATE pg_catalog."default",
    normalizedusername character varying(128) COLLATE pg_catalog."default",
    passwordhash character varying(512) COLLATE pg_catalog."default",
    phonenumber character varying(50) COLLATE pg_catalog."default",
    phonenumberconfirmed boolean NOT NULL,
    securitystamp character varying(255) COLLATE pg_catalog."default",
    twofactorenabled boolean NOT NULL,
    username character varying(50) COLLATE pg_catalog."default",
    locale integer NOT NULL DEFAULT 1,
    CONSTRAINT users_pkey PRIMARY KEY (id)
 )
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public.users
   OWNER to notifiedlocal;


CREATE INDEX emailindex
    ON public.users USING btree
    (normalizedemail COLLATE pg_catalog."default")
    TABLESPACE pg_default;


CREATE UNIQUE INDEX usernameindex
    ON public.users USING btree
    (normalizedusername COLLATE pg_catalog."default")
    TABLESPACE pg_default;

当我尝试从用户表中进行简单的获取时,这是我得到的错误:

  System.InvalidOperationException: 'An exception occurred while reading a database value. The expected type was 'System.Nullable`1[System.DateTimeOffset]'


"An exception occurred while reading a database value. The expected type was 
'System.Nullable`1[System.DateTimeOffset]' but the actual value was of type 
'System.DateTime'."

所以我不小心更新了postgres和.net标识,以便其中一方更改? 这曾经工作,我没有故意改变任何东西。 是否可以将身份实体更改为使用正常的日期时间?

0 个答案:

没有答案