The collection argument 'properties' must contain at least one element. when using dotnet ef

.net .net-core-2.0 entity-framework-core mariadb pomelo

Question

I have two very simple tables

CREATE TABLE `site` (
  `id` int(2) NOT NULL AUTO_INCREMENT,
  `Name` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

And

CREATE TABLE `program` (
  `Contract` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `Name` text COLLATE utf8_unicode_ci NOT NULL,
  `SiteId` int(2) NOT NULL,
  PRIMARY KEY (`Contract`),
  KEY `SiteId` (`SiteId`),
  CONSTRAINT `SiteId` FOREIGN KEY (`SiteId`) REFERENCES `site` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

There is a FK on the SiteId field of the program table.

When I try and generate my models using

dotnet ef dbcontext scaffold "constring" "Pomelo.EntityFrameworkCore.MySql" -f -o "Models"  -d

It returns the error

The collection argument 'properties' must contain at least one element.

Removing the FK the model generates fine. What is wrong with my model?

1
0
8/16/2017 4:26:37 PM

Accepted Answer

This error was resolved with version 2.0.0-rtm-10057.

0
8/20/2017 3:27:44 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow