Beispiel #1
0
        public async Task Delete(MicrotingDbContext dbContext)
        {
            field_types fieldTypes = await dbContext.field_types.FirstOrDefaultAsync(x => x.Id == Id);

            if (fieldTypes == null)
            {
                throw new NullReferenceException($"Could not find Field Type with Id: {Id}");
            }
            dbContext.Remove(fieldTypes);
            await dbContext.SaveChangesAsync().ConfigureAwait(false);
        }