public async Task <int> InsertData(IEnumerable <FileData> newdata, CancellationToken token) { await _db.Data.AddRangeAsync(newdata, token); try { return(await _db.SaveChangesAsync(true, token)); } catch (Exception e) { throw new Exception("Issue with SqlLite DB. Did you copy {repo root}/Backend/sample.db to C:/data?", e); } }
public async Task CreateAsync(LlpaUpsertDto dto, CancellationToken cancellationToken) { _ctx.Llpas.Add(dto.Map()); await _ctx.SaveChangesAsync(cancellationToken); }