V
V
VanilaSpirit2020-08-05 16:24:00
ASP.NET
VanilaSpirit, 2020-08-05 16:24:00

Update-database error, what could be the problem?

Created a new model and want to bind it in another model:

[ForeignKey("News")]
        [DataType("ForeignKey")]
        public int? NewsId { get; set; }
        public virtual News News{ get; set; }


When update-database produces Unhandled MigrationOperation RenameIndexOperation in NpgsqlMigrationSqlGenerator
BUT! By linking another model in the same way - everything updates successfully. In News, only the Text field.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yuopi, 2020-08-05
@yuopi

I think this is how it should work

[ForeignKey("NewsId")]
        public virtual News News{ get; set; }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question