I have a stored procedure called GetContactsByUserId @userId INT.
I want to call this stored procedure with Entity Framework Core (7.0.0-rc1-final).
The stored procedure return these types in the result:
ContactId INT, ContactName NVARCHAR(200)
I have created in C# the object called - Contact:
[Key]
public int ContactId {get; set;}
public string ContactName {get;set;}
And this DbSet:
public DbSet<Contact> Contacts { get; set; }
I've tried call the stored procedure like this:
_dbContext.Set<Contact>().FromSql("dbo.GetContactsByUserId @userId = {0}", userid);
After first call I get for example 30 rows. I add new records and try again call this procedure with the same parameter and I get 30 rows not 31 rows.
How can I fix this issue?