Beispiel #1
0
        public async Task Post([FromBody] SegmentsEntry value)
        {
            try {
                await _db.Segments.AddAsync(value);

                await _db.SaveChangesAsync();
            }
            catch (Exception e)
            {
                Console.WriteLine("error", e);
            }
        }
Beispiel #2
0
        public async Task Put(int id, [FromBody] SegmentsEntry value)
        {
            try {
                var old = await _db.Segments.FindAsync(id);

                _db.Entry(old).CurrentValues.SetValues(value);
                await _db.SaveChangesAsync();
            }
            catch (Exception e)
            {
                Console.WriteLine("error", e);
            }
        }