efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Query object with list of objects

Open ashelest opened this issue 8 years ago • 2 comments

Hi. Sorry for may be stupid question, but im done. Im trying to create query for complex object I have next query model public class QueryModel { public Guid ID { get; set; } public IEnumerable<string> Keys { get; set; } } Next mapping modelBuilder.Query<QueryModel>() .ToView("ViewName"); I get error InvalidOperationException: The property; CompanyQuery.Keys; could not be mapped, because it is of type; IEnumerable which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the [NotMapped] attribute

I feel like i need to configure manually somehow, but i just dont understand how.

ashelest avatar Nov 13 '18 12:11 ashelest

@ashelest What's the query you would like to execute that would return this model?

ajcvickers avatar Nov 13 '18 16:11 ajcvickers

Excuse for troubling, Resolved.

ashelest avatar Nov 20 '18 08:11 ashelest