{"action":"opened","issue":{"url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/78","repository_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql","labels_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/78/comments","events_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/78/events","html_url":"https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/78","id":181861099,"number":78,"title":"NotSupportedException, enum type not mapped to db type correctly. ","user":{"login":"liamwang","id":5000396,"avatar_url":"https://avatars.githubusercontent.com/u/5000396?v=3","gravatar_id":"","url":"https://api.github.com/users/liamwang","html_url":"https://github.com/liamwang","followers_url":"https://api.github.com/users/liamwang/followers","following_url":"https://api.github.com/users/liamwang/following{/other_user}","gists_url":"https://api.github.com/users/liamwang/gists{/gist_id}","starred_url":"https://api.github.com/users/liamwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liamwang/subscriptions","organizations_url":"https://api.github.com/users/liamwang/orgs","repos_url":"https://api.github.com/users/liamwang/repos","events_url":"https://api.github.com/users/liamwang/events{/privacy}","received_events_url":"https://api.github.com/users/liamwang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-09T02:40:16Z","updated_at":"2016-10-09T02:40:16Z","closed_at":null,"body":"### Steps to reproduce\r\nAdd an entity class with a enum type property. Such as:\r\n```csharp\r\n    public class Post : ModificationAuditedEntity\r\n    {\r\n        public int Id { get; set; }\r\n        public string Title { get; set; }\r\n        public string Body { get; set; }\r\n        public EditorType EditorType { get; set; }\r\n        ...\r\n    }\r\n\r\n    public enum EditorType : byte\r\n    {\r\n        WYSIWYG = 0,\r\n        Markdown = 1\r\n    }\r\n```\r\n\r\nCreate and savechages\r\nvar post = new Post{ ..., EditorType = EditorType.WYSIWYG  }\r\ncontext.Set<Post>().Add(post);\r\ncontext.SaveChanges();\r\n\r\n### The issue\r\nA NotSupportedException throwed at `context.SaveChanges();`。\r\n\r\n```\r\nException message:\r\n\r\nNotSupportedException: Parameter type EditorType (DbType: Byte) not currently supported. Value: WYSIWYG\r\n\r\nStack trace:\r\n\r\nSystem.NotSupportedException: Parameter type EditorType (DbType: Byte) not currently supported. Value: WYSIWYG\r\n   at MySql.Data.MySqlClient.MySqlParameter.AppendSqlString(BinaryWriter writer, StatementPreparerOptions options)\r\n   at MySql.Data.MySqlClient.MySqlStatementPreparer.ParameterSqlParser.DoAppendParameter(Int32 parameterIndex, Int32 textIndex, Int32 textLength)\r\n   at MySql.Data.MySqlClient.MySqlParser.Parse(String sql)\r\n   at MySql.Data.MySqlClient.MySqlStatementPreparer.ParseAndBindParameters()\r\n   at MySql.Data.MySqlClient.MySqlCommand.<ExecuteReaderAsync>d__50.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlRelationalCommand.<ExecuteAsync>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlRelationalCommand.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.Update.Internal.MySqlModificationCommandBatch.<ExecuteAsync>d__20.MoveNext()\r\n```\r\n\r\n### Further technical details\r\n\r\nMySQL version: 5.7\r\nOperating system: Windows 10\r\nPomelo.EntityFrameworkCore.MySql version: 1.0.1-prerelease-10014\r\n\r\n"}}
{"actor":{"display_login":"liamwang"}}