Changeset 63d885e for FarmatikoData/FarmatikoRepo/PandemicRepository.cs
- Timestamp:
- 08/07/20 11:01:25 (5 years ago)
- Branches:
- master
- Children:
- 5d02859
- Parents:
- ee137aa (diff), c406ae5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/FarmatikoRepo/PandemicRepository.cs
ree137aa r63d885e 22 22 public IQueryable<Pandemic> GetAll() 23 23 { 24 return _context.Pandemics.OrderBy(x => x.Name); 24 return _context.Pandemics.Select(x => new Pandemic 25 { 26 Name = x.Name, 27 TotalMK = x.TotalMK, 28 ActiveMK = x.ActiveMK, 29 DeathsMK = x.DeathsMK, 30 NewMK = x.NewMK, 31 TotalGlobal = x.TotalGlobal, 32 DeathsGlobal = x.DeathsGlobal, 33 ActiveGlobal = x.ActiveGlobal 34 }).OrderBy(x => x.Name); 25 35 } 26 36 27 37 public void Remove(Pandemic pandemic) 28 38 { 29 _context.Pandemics.Remove(pandemic); 30 _context.SaveChangesAsync(); 39 var Pandem = _context.Pandemics.Where(x => x.Name.Equals(pandemic.Name)).FirstOrDefault(); 40 if (Pandem != null) 41 { 42 _context.Pandemics.Remove(Pandem); 43 _context.SaveChangesAsync(); 44 } 31 45 } 32 46 }
Note:
See TracChangeset
for help on using the changeset viewer.