{"action":"created","issue":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1616","repository_url":"https://api.github.com/repos/volkanceylan/Serenity","labels_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1616/labels{/name}","comments_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1616/comments","events_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1616/events","html_url":"https://github.com/volkanceylan/Serenity/issues/1616","id":194871745,"number":1616,"title":"Sergen error with tables+foreignkeys","user":{"login":"SpiraMira","id":286122,"avatar_url":"https://avatars.githubusercontent.com/u/286122?v=3","gravatar_id":"","url":"https://api.github.com/users/SpiraMira","html_url":"https://github.com/SpiraMira","followers_url":"https://api.github.com/users/SpiraMira/followers","following_url":"https://api.github.com/users/SpiraMira/following{/other_user}","gists_url":"https://api.github.com/users/SpiraMira/gists{/gist_id}","starred_url":"https://api.github.com/users/SpiraMira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpiraMira/subscriptions","organizations_url":"https://api.github.com/users/SpiraMira/orgs","repos_url":"https://api.github.com/users/SpiraMira/repos","events_url":"https://api.github.com/users/SpiraMira/events{/privacy}","received_events_url":"https://api.github.com/users/SpiraMira/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-12T01:09:19Z","updated_at":"2016-12-12T07:36:48Z","closed_at":"2016-12-12T07:36:48Z","body":"Hi, I get the attached serene error when attempting to generate code for my tables with foreign keys.  \r\n\r\n```\r\nSerenity.CodeGenerator.EntityField does not contain a definition for Type'\r\n at CallSite.Target(Closure,Callsite,Object)\r\nat Serenity.CodeGenerator.Views.EntityRow.Execute()\r\n...\r\n```\r\n\r\nI confirmed my hunch by removing the foreign keys in sox and rerunning serene (successfully). Pretty simple Person table:\r\n\r\nCREATE TABLE [org].[Person] (\r\n    [PersonId]   INT            IDENTITY (1, 1) NOT NULL,\r\n    [Firstname]  NVARCHAR (50)  NOT NULL,\r\n    [Middlename] NVARCHAR (50)  NOT NULL,\r\n    [Lastname]   NVARCHAR (50)  NOT NULL,\r\n    [BirthPlace] NVARCHAR (100) NULL,\r\n    [BirthDate]  DATETIME       NULL,\r\n    [Gender]     INT            NULL,\r\n    [Location]   INT            NULL,\r\n    [Photo]      NVARCHAR (255) NULL,\r\n    CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED ([PersonId] ASC),\r\n    CONSTRAINT [FK_Person_GenderId] FOREIGN KEY (Gender) REFERENCES [org].Gender (GenderId)\r\n);\r\n\r\nThe snapshot is from the the latest 2.6.8 of Serenity.Code. In fact here is my current packages.config:\r\n\r\n`<packages>\r\n  <package id=\"bootstrap\" version=\"3.3.7\" targetFramework=\"net45\" />\r\n  <package id=\"CsQuery\" version=\"1.3.4\" targetFramework=\"net45\" />\r\n  <package id=\"Dapper\" version=\"1.42\" targetFramework=\"net45\" />\r\n  <package id=\"EPPlus\" version=\"4.1.0\" targetFramework=\"net45\" />\r\n  <package id=\"flot\" version=\"0.8.3\" targetFramework=\"net45\" />\r\n  <package id=\"FluentMigrator\" version=\"1.6.2\" targetFramework=\"net45\" />\r\n  <package id=\"FluentMigrator.Runner\" version=\"1.6.2\" targetFramework=\"net45\" />\r\n  <package id=\"jQuery\" version=\"3.1.1\" targetFramework=\"net45\" />\r\n  <package id=\"jquery.blockUI.TypeScript.DefinitelyTyped\" version=\"0.0.4\" targetFramework=\"net45\" />\r\n  <package id=\"jquery.cookie.TypeScript.DefinitelyTyped\" version=\"0.2.1\" targetFramework=\"net45\" />\r\n  <package id=\"jquery.TypeScript.DefinitelyTyped\" version=\"3.1.2\" targetFramework=\"net45\" />\r\n  <package id=\"jQuery.UI.Combined\" version=\"1.12.1\" targetFramework=\"net45\" />\r\n  <package id=\"jQuery.Validation\" version=\"1.15.1\" targetFramework=\"net45\" />\r\n  <package id=\"jquery.validation.TypeScript.DefinitelyTyped\" version=\"0.4.5\" targetFramework=\"net45\" />\r\n  <package id=\"jqueryui.TypeScript.DefinitelyTyped\" version=\"1.5.1\" targetFramework=\"net45\" />\r\n  <package id=\"jspdf.TypeScript.DefinitelyTyped\" version=\"0.0.4\" targetFramework=\"net45\" />\r\n  <package id=\"Microsoft.AspNet.Mvc\" version=\"5.2.3\" targetFramework=\"net45\" />\r\n  <package id=\"Microsoft.AspNet.Razor\" version=\"3.2.3\" targetFramework=\"net45\" />\r\n  <package id=\"Microsoft.AspNet.WebPages\" version=\"3.2.3\" targetFramework=\"net45\" />\r\n  <package id=\"Microsoft.Web.Infrastructure\" version=\"1.0.0.0\" targetFramework=\"net45\" />\r\n  <package id=\"MsieJavaScriptEngine\" version=\"2.0.0\" targetFramework=\"net45\" />\r\n  <package id=\"Newtonsoft.Json\" version=\"9.0.1\" targetFramework=\"net45\" />\r\n  <package id=\"Select2.js\" version=\"3.5.1\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.CodeGenerator\" version=\"2.6.8\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.Core\" version=\"2.6.8\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.Data\" version=\"2.6.8\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.Data.Entity\" version=\"2.6.8\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.Services\" version=\"2.6.8\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.Web\" version=\"2.6.8\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.Web.Assets\" version=\"2.6.6\" targetFramework=\"net45\" />\r\n  <package id=\"Serenity.Web.Tooling\" version=\"2.6.6\" targetFramework=\"net45\" />\r\n  <package id=\"sortablejs.TypeScript.DefinitelyTyped\" version=\"0.1.8\" targetFramework=\"net45\" />\r\n  <package id=\"StackExchange.Exceptional\" version=\"1.0.122\" targetFramework=\"net45\" />\r\n  <package id=\"toastr\" version=\"2.1.1\" targetFramework=\"net45\" />\r\n  <package id=\"toastr.TypeScript.DefinitelyTyped\" version=\"0.3.1\" targetFramework=\"net45\" />\r\n  <package id=\"wkhtmltopdf-x86-win32\" version=\"0.12.3.6\" targetFramework=\"net45\" />\r\n</packages>`\r\n\r\nYou can tell from the screen capture that I ran a multiple table sergen.  Only my tables without foreign keys worked as expected.  Thanks for your help.\r\n\r\n\r\n![sergen-error](https://cloud.githubusercontent.com/assets/286122/21085091/3098f054-bfdb-11e6-9037-f8bfb7d7e522.png)"},"comment":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/comments/266361456","html_url":"https://github.com/volkanceylan/Serenity/issues/1616#issuecomment-266361456","issue_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1616","id":266361456,"user":{"login":"volkanceylan","id":752470,"avatar_url":"https://avatars.githubusercontent.com/u/752470?v=3","gravatar_id":"","url":"https://api.github.com/users/volkanceylan","html_url":"https://github.com/volkanceylan","followers_url":"https://api.github.com/users/volkanceylan/followers","following_url":"https://api.github.com/users/volkanceylan/following{/other_user}","gists_url":"https://api.github.com/users/volkanceylan/gists{/gist_id}","starred_url":"https://api.github.com/users/volkanceylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volkanceylan/subscriptions","organizations_url":"https://api.github.com/users/volkanceylan/orgs","repos_url":"https://api.github.com/users/volkanceylan/repos","events_url":"https://api.github.com/users/volkanceylan/events{/privacy}","received_events_url":"https://api.github.com/users/volkanceylan/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T07:36:48Z","updated_at":"2016-12-12T07:36:48Z","body":"It's an option added by somebody else, which adds #region directives around fields i think. I'm not a fan of regions."}}
{"actor":{"display_login":"volkanceylan"}}