c#


Exclude entities from updating


I have an entity A and A has it's own navigation properties. Sometimes those navigation properties are null, and sometimes are not. When they are not null, I can set their state like,
context.Entry(A.b).State = EntityState.Unchanged;
Everything is fine until here.
Now, if a navigation property is null, I cant get a state or anything from a null object, therefore i cant set its state.
My question is, how do you exclude a null navigation property of an entity from saving to database?

Related Links

Persisting application state in ASP.NET website
Passing enum command line arguments
Casting object to generic IEnumerable with only type available
Code efficiency for drawing in C#?
How to update new value with old values in ListView in C#
List of methods to assign to various classes C#
How to append .wav format sounds to each other
Customize Lucene.net search result
Parallelization of CPU bound task continuing with IO bound
Rewriting TreeView's Draw node method
VB6 Format equivalent in C#
How to add Contols Dynamically in DataGridView Row in Windows Form Application?
How to make multiple tables from one single xsd file? [closed]
XMLDocument GetElementByID returning null
Programmatically call C# Compiler to Compile C# code
Microsoft.SqlServer.Management.SqlParser nedded in clickonce

Categories

HOME
asterisk
gulp
skype-for-business
stata
cors
mysqli
pelican
skypedeveloper
gaussian
data-modeling
singleton
app-store
esxi
sms
grid
sdk
terminal
opacity
kendo-asp.net-mvc
markdown
jcodemodel
opendaylight
popup
nsoperation
powerpivot
geography
indri
views
custom-component
policy
struts
android-wear-2.0
chartist.js
jopendocument
custom-fields
ios9
deferred
mootools
perf
maven-2
extern
realloc
office-interop
ssdp
vertical-alignment
head
intervention
f#-fake
angular-fullstack
line-endings
dcom
openidm
appcmd
lightspeed
google-scholar
blitz3d
git-push
normalisation
change-password
system-integration
user-profile
dcast
trendline
oryx
std
jersey-test-framework
angular-promise
play-json
pushwoosh
sparkcore
clearquest
cakephp-2.6
stderr
radgrid
maven-archetype
firebase-tools
chrome-mobile
dockerpy
fiware-health
xcode5
jsonmodel
illegalargumentexception
growl
cs193p
code-smell
opencobol
sqldatasource
object-oriented-database
internet-radio
google-mirror-api
azure-pack
phone-state-listener
ntdll
rbm
django-tinymce
mysql-connector
win-prolog
automapper-2
backlight
qvariant
xhtmlrenderer
lwp
cpack
onunload
subdirectories
oaw
mysql-logic
dgml
pkcs#7
tracd

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App