Entity Framework 5 (列挙型をサポートする) で列挙型がマッピングされないという問題がありました。
where results is a IQueryableを呼び出すとresults.Where(r => r.Category = LogEntry.LogCategory.ERROR)
、Specified type member LogCategory is not supported in LINQ to Entities が表示されます。
移行を実行すると、Up() メソッドがテーブルをマップしません。
私のモデルは次のようになります
public partial class LogEntry
{
public enum HttpMethod
{
GET,
POST,
PUT,
DELETE
};
public enum LogCategory
{
PAGE_VISIT,
TRANSACTION,
AUTHENTICATION,
FAILED_AUTHENTICATION,
EXCEPTION,
INPUT_VALIDATION_ERROR,
SPECIFICATION_FAILURE,
SYSTEM,
PAGE_NOT_FOUND,
UNAUTHORIZED_ACCESS
};
public int LogId { get; set; }
//public int? UserId { get; set; }
//public virtual User user { get; set; }
//public int? ForumId { get; set; }
//public virtual Forum forum { get; set; }
public DateTime DateTime { get; set; }
public string IPAddress { get; set; }
public string ActiveRole { get; set; }
public string Title { get; set; }
public string Details { get; set; }
public LogCategory Category { get; set; }
public String Url { get; set; }
public HttpMethod Method { get; set; }
public Boolean IsAjaxRequest { get; set; }
public String UserAgent { get; set; }
}
誰が問題が何であるかについて何か考えを持っていますか?