public async Task <ActionResult <FamilySection> > PostFamilySection(FamilySection familySection) { _context.FamilySections.Add(familySection); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFamilySection", new { id = familySection.FamilySectionId }, familySection)); }
public FamilySection ParseFamilySectionLine(string[] line, int lineId, string sra) { int familySectionLineId = lineId; string family = line[0].Split(new char[] { '=' })[1]; int score = int.Parse(line[1].Split(new char[] { '=' })[1]); int pctId = int.Parse(line[2].Split(new char[] { '=' })[1]); int aln = int.Parse(line[3].Split(new char[] { '=' })[1]); int glb = int.Parse(line[4].Split(new char[] { '=' })[1]); int panLen = int.Parse(line[5].Split(new char[] { '=' })[1]); string cvg = line[6].Split(new char[] { '=' })[1]; string top = line[7].Split(new char[] { '=' })[1]; int topAln = int.Parse(line[8].Split(new char[] { '=' })[1]); int topLen = int.Parse(line[9].Split(new char[] { '=' })[1]); string topName = line[10].Split(new char[] { '=' })[1]; var familySection = new FamilySection { FamilySectionLineId = familySectionLineId, Sra = sra, Family = family, Score = score, PctId = pctId, Aln = aln, Glb = glb, PanLen = panLen, Cvg = cvg, Top = top, TopAln = topAln, TopLen = topLen, TopName = topName, }; return(familySection); }
public async Task <IActionResult> PutFamilySection(int id, FamilySection familySection) { if (id != familySection.FamilySectionId) { return(BadRequest()); } _context.Entry(familySection).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FamilySectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }