Exemple #1
0
        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);
        }
Exemple #2
0
 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;
     }
 }