using System.Collections.Immutable; using Connected.Entities; using Connected.ServiceModel; using Connected.Services; using Ops = Connected.Logistics.Types.Packaging.PackingOps; namespace Connected.Logistics.Types.Packaging; internal sealed class PackingService : EntityService, IPackingService { public PackingService(IContext context) : base(context) { } public async Task Delete(PrimaryKeyArgs args) { await Invoke(GetOperation(), args); } public async Task Insert(InsertPackingArgs args) { return await Invoke(GetOperation(), args); } public async Task Patch(PatchArgs args) { if (await Select(args.Id) is not Packing entity) return; await Update(args.Patch(entity)); } public async Task> Query(QueryArgs? args) { return await Invoke(GetOperation(), args ?? QueryArgs.Default); } public async Task> Query(PrimaryKeyListArgs args) { return await Invoke(GetOperation(), args); } public async Task Select(PrimaryKeyArgs args) { return await Invoke(GetOperation(), args); } public async Task Select(SelectPackingArgs args) { return await Invoke(GetOperation(), args); } public async Task Update(UpdatePackingArgs args) { await Invoke(GetOperation(), args); } }