Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        public async Task CreateAsync(LlpaUpsertDto dto, CancellationToken cancellationToken)
        {
            _ctx.Llpas.Add(dto.Map());

            await _ctx.SaveChangesAsync(cancellationToken);
        }