Breeze not updating nullable datetime field -


i'm setting nullable datetime field on server field not being updated in database.

        private bool beforesaveleaseentry(lease leaseentry, entityinfo info)     {         if (info.entitystate == entitystate.added)         {             leaseentry.createddate = datetime.utcnow.tolocaltime();         }         if (info.entitystate == entitystate.modified)         {             leaseentry.lastupdateddate = datetime.utcnow.tolocaltime();         }         return true;     } 

createddate not nullable , updated. lastupdateddate nullable , never updated.

the code hit when run tracer on sql server field never included in update code.

exec sp_executesql n'update [dbo].[leases] set [contractno] = @0 ([leaseid] = @1) ',n'@0 varchar(25),@1 int',@0='test6',@1=27415 

sorry this, in breeze v 1.1.3 added entityinfo.forceupdate boolean property never made main breeze documentation, appeared in release notes.

this property may used force server side update of entire entity when server side modification has been made property of existing entity. other approach may used explicitly update entityinfo.originalvaluesmap.

the idea behind both of these on update breeze creates update statement se properties have been changed. client side changes automatically detected because of breeze's tracking mechanism adds entry 'originalvaluesmap', cannot done automatically server side changes because server side entities not instrumented perform notification property changes.

the "entityinfo.forceupdate" method forces generation of update statement every property on entity, whereas directly updating entityinfo.originalvaluesmap update properties found in map.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -