예제 #1
0
 public async Task <AsycudaDocumentSetEntryDataDetails> CreateAsycudaDocumentSetEntryDataDetails(AsycudaDocumentSetEntryDataDetails entity)
 {
     try
     {
         using (var t = new AsycudaDocumentSetEntryDataDetailsClient())
         {
             return(new AsycudaDocumentSetEntryDataDetails(await t.CreateAsycudaDocumentSetEntryDataDetails(entity.DTO).ConfigureAwait(continueOnCapturedContext: false)));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
예제 #2
0
        public async Task <AsycudaDocumentSetEntryDataDetails> UpdateAsycudaDocumentSetEntryDataDetails(AsycudaDocumentSetEntryDataDetails entity)
        {
            if (entity == null)
            {
                return(entity);
            }
            var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault();

            if (entitychanges != null)
            {
                try
                {
                    using (var t = new AsycudaDocumentSetEntryDataDetailsClient())
                    {
                        var updatedEntity = await t.UpdateAsycudaDocumentSetEntryDataDetails(entitychanges).ConfigureAwait(false);

                        entity.EntityId = updatedEntity.EntityId;
                        entity.DTO.AcceptChanges();
                        //var  = entity.;
                        //entity.ChangeTracker.MergeChanges(,updatedEntity);
                        //entity. = ;
                        return(entity);
                    }
                }
                catch (FaultException <ValidationFault> e)
                {
                    throw new Exception(e.Detail.Message, e.InnerException);
                }
                catch (Exception)
                {
                    Debugger.Break();
                    throw;
                }
            }
            else
            {
                return(entity);
            }
        }