public async Task <ShopsFileScope> CreateAsync(ShopsFileScope shopsFileScope, CancellationToken cancellationToken = default(CancellationToken)) { if (shopsFileScope == null) { throw new ArgumentNullException(nameof(shopsFileScope)); } Context.Add(shopsFileScope); await Context.SaveChangesAsync(cancellationToken); return(shopsFileScope); }
public async Task DeleteAsync(ShopsFileScope shopsFileScope, CancellationToken cancellationToken = default(CancellationToken)) { if (shopsFileScope == null) { throw new ArgumentNullException(nameof(shopsFileScope)); } Context.Remove(shopsFileScope); try { await Context.SaveChangesAsync(cancellationToken); } catch (DbUpdateConcurrencyException) { throw; } }