Execute Stored Procedure using Context.Database.SqlQuery<T> and Complex Type mapping
complextype, ef-code-first, entity-framework, mapping, stored-procedures
Solution
This is not supported at the moment. You cannot return entity containing complex types from `SqlQuery`.
Problem
I have a class called Product with this structure: ``` public class Product { public long Id { get; set; } public string Title { get; set; } public string Summary { get; set; } public string Description { get; set; } public long ProductCategoryId { get; set; } public virtual ProductCategory ProductCategory { get; set; } public ConstantPost ConstantPost { get; set; } } ``` there is a complex type called ConstantPost. when i want to execute a Stored Procedure called MostBought i get this error: Cannot create a value for property 'ConstantPost' of type 'Domain.ConstantPost'. Only properties with primitive types are supported. how can i ignore complex types when executing stored procedures. thanks in advance.