Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public async Task<bool> UpdateSituation(int id, SituationsDto data)
  2. {
  3. Situations result = _mapper.Map<SituationsDto, Situations>(data);
  4. result.Deleted = true;
  5.  
  6. _context.Entry(result).State = EntityState.Modified;
  7. await _context.SaveChangesAsync();
  8.  
  9. SituationCategories situationCategory = new SituationCategories();
  10.  
  11. if (result.SituationCategory != null)
  12. {
  13. if (situationCategory != null)
  14. {
  15. situationCategory.Description = result.SituationCategory.Description;
  16. }
  17. }
  18.  
  19. await _context.SaveChangesAsync();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement