0

I have three tables and one view in sql server. I am able to get data of tables but not sure how view would work.

I have created entity mapping of view and entry to context.

public DbSet VDeviceReturnAuthorization { get; }

But i am getting exception message The entity 'VDeviceReturnAuthorization' does not have a key defined.

Anyone have idea?

Fooker
  • 786
  • 2
  • 10
  • 19
  • 2
    http://stackoverflow.com/questions/1013333/entity-framework-and-sql-server-view – Steve Greene Jul 08 '16 at 20:46
  • Can I know which library you are using? Do you use RESTier http://odata.github.io/RESTier/ or Web Api odata http://odata.github.io/WebApi/? If yes, you can add [Key] attribute to the view CLR class for the property which are used as key. – Vincent Jul 11 '16 at 05:00

0 Answers0