entity framework view not refreshing

November 23, 2015

https://christianarg.wordpress.com/2013/06/13/entityframework-refreshall-loaded-entities-from-database/

AsNoTracking

http://stackoverflow.com/questions/22177491/how-to-force-entity-framework-to-always-get-updated-data-from-the-database


Entity framework stored procedure always returning int

October 5, 2015

http://www.devtoolshed.com/using-stored-procedures-entity-framework-scalar-return-values

http://stackoverflow.com/questions/18245567/stored-procedure-returns-int-instead-of-result-set

I have a stored procedure that contains dynamic select. Something like this:

ALTER PROCEDURE [dbo].[usp_GetTestRecords]
–@p1 int = 0,
–@p2 int = 0
@groupId nvarchar(10) = 0
AS
BEGIN
SET NOCOUNT ON;

DECLARE @query NVARCHAR(max)

SET @query = ‘SELECT * FROM CUSTOMERS WHERE Id = ‘ + @groupId
/* This actually contains a dynamic pivot select statement */

EXECUTE(@query);
END

Answer :

SET FMTONLY OFF

or


Entity Framework notes

May 24, 2015

How do I delete multiple rows in Entity Framework (without foreach)

db.People.RemoveRange(db.People.Where(x => State == “CA”));

How to delete single row in Entity Framework

use remove() method


.Net notes : Entity Framework

May 1, 2015

‘Unable to update the EntitySet ‘xxxxxxxx’ because it has a DefiningQuery and no element exists in the element to support the current operation.’

Please check:

1. Make sure you have ”xxxxxxx” table in your datgbase

2. Make sure you have the Primary Key in that table

3. If the the table and Primary Key are existing, please updated the Entity map and publish again.