public async Task <IActionResult> PutReadingTypes(string id, ReadingTypes readingTypes) { if (id != readingTypes.ReadingTypeId) { return(BadRequest()); } _context.Entry(readingTypes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReadingTypesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ReadingTypes> > PostReadingTypes(ReadingTypes readingTypes) { _context.ReadingTypes.Add(readingTypes); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (ReadingTypesExists(readingTypes.ReadingTypeId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetReadingTypes", new { id = readingTypes.ReadingTypeId }, readingTypes)); }
public ReadingsString <ReadingTypes> ProcessWithReadings(string text, ReadingTypes readingsToUse) => new ReadingsString <ReadingTypes>(text.SplitIntoSurrogatePairs()
public string Process(string text, ReadingTypes readingsToUse) => string.Join("", ProcessWithReadings(text, readingsToUse).Characters .Select(c => c.Readings.Length > 0 ? c.Readings[0].Value : c.Character));