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

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