Exemplo n.º 1
0
 public SanityMutationBuilder <TDoc> PatchById(SanityPatchById <TDoc> patchById)
 {
     lock (GetLock())
     {
         InnerBuilder.Mutations.Add(new SanityPatchMutation(patchById)
         {
             DocType = typeof(TDoc)
         });
         return(this);
     }
 }
Exemplo n.º 2
0
        //public SanityTransactionBuilder<TDoc> PatchById(string id, object patch)
        //{
        //    lock (GetLock())
        //    {
        //        var sPatch = JsonConvert.SerializeObject(patch);
        //        var oPatch = JsonConvert.DeserializeObject<SanityPatchById<TDoc>>(sPatch);
        //        oPatch.Id = id;
        //        InnerBuilder.Mutations.Add(new SanityPatchMutation(oPatch) { DocType = typeof(TDoc) });
        //        return this;
        //    }
        //}


        public SanityMutationBuilder <TDoc> PatchById(string id, Action <SanityPatch> patch)
        {
            lock (GetLock())
            {
                var oPatch = new SanityPatchById <TDoc>(id);
                patch.Invoke(oPatch);
                InnerBuilder.Mutations.Add(new SanityPatchMutation(oPatch)
                {
                    DocType = typeof(TDoc)
                });
                return(this);
            }
        }
Exemplo n.º 3
0
 public SanityPatchMutation(SanityPatchById patch)
 {
     Patch = patch;
 }