New Posts New Posts RSS Feed: How to Save Entity without the Automatic requery
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How to Save Entity without the Automatic requery

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: How to Save Entity without the Automatic requery
    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




Edited by gregweb - 14-Nov-2012 at 2:46pm
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 14-Nov-2012 at 3:45pm
Hi Greg,
 
Have you tried using EntityTypesExcludedFromPostSaveRefetch:
 
saveOptions.EntityTypesExcludedFromPostSaveRefetch = new Type[] {LoggingEntityType};
 
sbelini.
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 14-Nov-2012 at 5:17pm
Thanks Silvo, that works perfectly.

Greg
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down