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