c# - Is there an attribute like [Table()] to create a class that maps to a view in EF Code First? -
i working entity framework code first, , trying create class map view. know how table, below:
[table("fil002")] public class fil002 { [key] [databasegeneratedattribute(databasegeneratedoption.none)] public int64 payer_number { get; set; } public string payer_name { get; set; } } however, not find attribute view (like [table(...)]. there one?
views queried in exact same way tables. therefore, use [table()] usual.
this not make associated db collection read-only though, have make sure not try save of objects out of (unless view writable of course).
Comments
Post a Comment