This commit is contained in:
2019-05-20 19:09:08 +00:00
parent 7d11399574
commit dd2b227d88
9 changed files with 16 additions and 29 deletions

View File

@@ -45,12 +45,10 @@ namespace AyaNova.Biz
//put
internal bool Put(UserOptions dbObj, UserOptions inObj)
{
//preserve the owner ID if none was specified
if (inObj.OwnerId == 0)
inObj.OwnerId = dbObj.OwnerId;
//Replace the db object with the PUT object
CopyObject.Copy(inObj, dbObj, "Id, UserId, OwnerId");
CopyObject.Copy(inObj, dbObj, "Id, UserId");
//Set "original" value of concurrency token to input token
//this will allow EF to check it out
ct.Entry(dbObj).OriginalValues["ConcurrencyToken"] = inObj.ConcurrencyToken;
@@ -98,11 +96,8 @@ namespace AyaNova.Biz
//UserOptions is never new, it's created with the User object so were only here for an edit
//OwnerId required
if (inObj.OwnerId == 0)
AddError(ApiErrorCode.VALIDATION_REQUIRED, "OwnerId");
//OwnerId required
//UserId required
if (inObj.UserId == 0)
AddError(ApiErrorCode.VALIDATION_REQUIRED, "UserId");