Print Page | Close Window

How to Save Entity without the Automatic requery

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3797
Printed Date: 08-Jun-2025 at 1:19am


Topic: How to Save Entity without the Automatic requery
Posted By: gregweb
Subject: How to Save Entity without the Automatic requery
Date Posted: 14-Nov-2012 at 2:35pm
I have a database which is used for logging data only. The connection login that is used has only write permissions in the database, not select. This works to save the entity, but then DF queries the database, usually to get the new ID. This throws an error in this case as there is no select permissions.

A guid is being used as the ID, so there is really no reason to do the query after the save.

The RequiresAuthenication attribute does not work as the user is not authenticated, and so it doesn't allow writing to the database.

I am just trying to lock down the data as much as possible.

Greg





Replies:
Posted By: sbelini
Date Posted: 14-Nov-2012 at 3:45pm
Hi Greg,
 
Have you tried using EntityTypesExcludedFromPostSaveRefetch:
 
saveOptions.EntityTypesExcludedFromPostSaveRefetch = new Type[] {LoggingEntityType};
 
sbelini.


Posted By: gregweb
Date Posted: 14-Nov-2012 at 5:17pm
Thanks Silvo, that works perfectly.

Greg



Print Page | Close Window