model.cs
[Column(TypeName = "json")]
public string application_role { get; set; }
这是MySQL,特定列的数据类型是json
,如何将其添加到模型类中。我尝试使用DataAnnotations但出现错误。
The specified type member 'application_role' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
Linq查询获取数据
context.sc_employee_details
.Where(e => e.user_name.Equals(userName))
.Select(o => o.application_role).SingleOrDefault();
}`
- Praveen R