diff --git a/zero.Raven/Operations/RavenOperations.Write.cs b/zero.Raven/Operations/RavenOperations.Write.cs index c4e32afe..dc0b596b 100644 --- a/zero.Raven/Operations/RavenOperations.Write.cs +++ b/zero.Raven/Operations/RavenOperations.Write.cs @@ -20,7 +20,6 @@ public partial class RavenOperations : IRavenOperations } T previousModel = null; - bool isUpdate = false; // check if the Id for a model already exists if (!model.Id.IsNullOrEmpty()) @@ -38,8 +37,6 @@ public partial class RavenOperations : IRavenOperations { return Result.Fail("@errors.oncreate.idmismatch"); } - - isUpdate = true; } // validate flavor @@ -66,13 +63,13 @@ public partial class RavenOperations : IRavenOperations } // create ID before-hand so interceptors can use it - if (!isUpdate) + if (!update) { model.Id = await GenerateId(model); } // run interceptor - InterceptorInstruction instruction = isUpdate ? Interceptors.ForUpdate(model, previousModel) : Interceptors.ForCreate(model); + InterceptorInstruction instruction = update ? Interceptors.ForUpdate(model, previousModel) : Interceptors.ForCreate(model); if (InterceptorBlocker == null && !await instruction.Start(this)) {