public async Task SaveContainer(ContainerEx container) { container.ModifiedProperties = null; using (var ctx = new EntryDataDS.Business.Services.ContainerService() { StartTracking = true }) { var cnt = await ctx.GetContainerByKey(container.Container_Id.ToString(), new List <string>() { "ContainerAsycudaDocumentSets" }).ConfigureAwait(false) ?? new Container(true) { TrackingState = TrackingState.Added }; cnt.InjectFrom(container); if (!cnt.ContainerAsycudaDocumentSets.Any(x => x.AsycudaDocumentSetId == container.AsycudaDocumentSetId)) { cnt.ContainerAsycudaDocumentSets.Add(new ContainerAsycudaDocumentSet(true) { Container = cnt, AsycudaDocumentSetId = container.AsycudaDocumentSetId.GetValueOrDefault(), TrackingState = TrackingState.Added }); } cnt.ModifiedProperties = null; await ctx.UpdateContainer(cnt).ConfigureAwait(false); } }
public async Task <ContainerEx> CreateContainerEx(ContainerEx entity) { return(await Channel.CreateContainerEx(entity).ConfigureAwait(false)); }
public async Task SaveContainer(ContainerEx container) { await Channel.SaveContainer(container).ConfigureAwait(false); }