Beispiel #1
0
 public async Task MatchToCurrentItem(int currentDocumentItem, OverShortDetailsEX osd)
 {
     using (var t = new OverShortDetailsEXClient())
     {
         await t.MatchToCurrentItem(currentDocumentItem, osd.DTO).ConfigureAwait(false);
     }
 }
 public async Task <OverShortDetailsEX> CreateOverShortDetailsEX(OverShortDetailsEX entity)
 {
     try
     {
         using (var t = new OverShortDetailsEXClient())
         {
             return(new OverShortDetailsEX(await t.CreateOverShortDetailsEX(entity.DTO).ConfigureAwait(continueOnCapturedContext: false)));
         }
     }
     catch (FaultException <ValidationFault> e)
     {
         throw new Exception(e.Detail.Message, e.InnerException);
     }
     catch (Exception)
     {
         Debugger.Break();
         throw;
     }
 }
        public async Task <OverShortDetailsEX> UpdateOverShortDetailsEX(OverShortDetailsEX entity)
        {
            if (entity == null)
            {
                return(entity);
            }
            var entitychanges = entity.ChangeTracker.GetChanges().FirstOrDefault();

            if (entitychanges != null)
            {
                try
                {
                    using (var t = new OverShortDetailsEXClient())
                    {
                        var updatedEntity = await t.UpdateOverShortDetailsEX(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);
            }
        }