public static void ParseFromSanction(this SanctionDto result, Sanction sourse)
 {
     result.BrokenRule     = sourse.BrokenRule;
     result.UserId         = sourse.UserId;
     result.ModeratorId    = sourse.ModeratorId;
     result.IsTemporary    = sourse.IsTemporary;
     result.ExpirationDate = sourse.ExpirationDate;
     result.Type           = sourse.Type;
     result.IsActive       = sourse.IsActive;
 }
 public void Add(Sanction sanction)
 {
     using (var context = new EduhubContext(_connectionString))
     {
         var sanctionDto = new SanctionDto();
         sanctionDto.ParseFromSanction(sanction);
         context.Sanctions.Add(sanctionDto);
         context.SaveChanges();
         sanction.Id = sanctionDto.Id;
     }
 }
 public static Sanction ParseFromSanctionDto(SanctionDto source)
 {
     return(new Sanction(source.Id, source.BrokenRule, source.UserId,
                         source.ModeratorId, source.IsTemporary, source.ExpirationDate, source.Type, source.IsActive));
 }