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

asp.net ImageConversion.aspx webcam is not working in IIS
Added token to header when sending json
How long can an Azure Blob Container Name be?
Using Automapper to map an objects list
adding 2 decimal places to Convert.ToString [duplicate]
Does SmtpClient.Timeout Property work for asyncronous calls?
Getting an error with my INSERT statement
Is there a way to use the template in a templated control as a control itself with properties?
Encrypt a web api request body content and decrypt on server
Write data to Google Spreadsheet using API Key (C#)
Is there a way to map stored procedure from SQL Server in C# without Entity Framework?
How to detect file copying process has finished in C#
Routing attribute in web api ignore part of uri
LAMBDA C# union informations
How to test functions using File.Create() and File.Delete() methods in xunit?
Howto get published content from Umbraco API controller ASP.NET

Categories

HOME
classification
gcc
grizzly
apache-storm
phantomjs
glsl
readdir
data-modeling
redhawksdr
ms-application-insights
mingw
localhost
confluence-rest-api
jshell
atlassian-fisheye
autocad
flowtype
collision-detection
handlebars.js
rmarkdown
promotions
digital
xmlhttprequest
fastreport
exchange-transport-agents
vivado-hls
react-jsx
webgl-earth
rndis
prepros
ecmascript-2017
policy
traveling-salesman
android-6.0-marshmallow
boosting
sqldependency
jms-topic
hierarchy
deferred
boost-log
key-bindings
opencsv
imageprocessor
n1ql
cocoa-scripting
pyenv
cache-control
kdevelop
queryover
iterm2
gem-fury
fisheye
mixed-models
file-descriptor
compiler-warnings
libzip
taiga
npoco
anonymous-function
rivets.js
emacs24
vertex
htop
sp
lightspeed
ldd
settext
virtualenvwrapper
csc
sprockets
airwatch
db2-zos
user-profile
android-progressbar
wordpress-plugin
musicbrainz
avrcp
photogrammetry
screen-lock
google-experiments
cordova-3
method-overloading
os.walk
nest-initiative
image-preloader
sqldatasource
connections
html5-filesystem
flask-mongoengine
nvcc
xml-validation
aspnet-compiler
tlbimp
mandelbrot
cocotron
phone-state-listener
zepto
linqdatasource
yii-components
correctness
bindinglist
dancer
mysql-connector
jqzoom
discussion-board
activescaffold
silverlight-2.0
webdb

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