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

How to determine the number of right bit-shifts needed for a power of two value?
How to create Class object in .cshtml page MVC3?
SQL: simple JOIN gives error
Show wait image/text while loading an ASP.NET page
Drop Down List binded, auto select an Item/make a specific Item first
Dropdownlist postback to default selected value?
asp.net c# convert filestream to image
Can WIX modify XML files inside an XAP package?
How to Add shortcut key to checkbox without text
Why do I need LINQ if I use NHibernate-like ORMs?
Showing a Visual Studio 2005 window at design time
How to trigger an event when any of CheckState values in CheckListBox is changed
Scrollable and drawing panel
Get the value of a stored procedure with SQL Server Express
Only allow children of certain type in WPF/XAML?
Log external but not own assembly first chance exceptions

Categories

HOME
c#
max
algolia
gsm
openacc
wifi
weblogic
x86-64
spotfire
query-string
symfony-sonata
yuv
procmon
ejb-3.0
ios-universal-links
openbsd
decoding
comma
filehelpers
turn.js
cherrypy
include-path
vala
aws-iot
rollupjs
visual-studio-community
stack-trace
vtd-xml
overflow
jmsserializerbundle
ng2-bootstrap
contextmenustrip
storefront
android-scrollview
imageprocessor
bootcamp
word-wrap
fisheye
google-cloud-powershell
autodesk-data-management
binary-decision-diagram
apiman
bootstrap-carousel
inner-join
gridgain
reqif
easyquery
import.io
django-tables2
riemann
jtextarea
node.js-client
qt3d
google-scholar
turbolinks
qtruby
sprockets
nimbus
django-taggit
treelist
radar-chart
paypal-subscriptions
app-data
tvp
serial-communication
eula
clearquest
targetprocess
chrome-mobile
aiff
vundle
smartxls
connections
logo-lang
nop
randomaccessfile
raddatepicker
ojb
friendly-url
dynamic-expresso
infinity.js
gwt2
string-length
waveout
php-gettext
unordered-set
inserthtml
project-files
joomla1.7
functional-specifications
cryptolicensing
norton
html5-animation
cinder
pitch-shifting
versions
calendarextender
retrospectiva
atmega16
authkit
cstring
vista64
memory-consumption

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