| | 1 | | using MRA.DTO.Enums.Inspirations; |
| | 2 | | using MRA.DTO.Mapper.Interfaces; |
| | 3 | | using MRA.DTO.Models; |
| | 4 | | using MRA.Infrastructure.Database.Documents.Interfaces; |
| | 5 | | using MRA.Infrastructure.Database.Documents.MongoDb; |
| | 6 | |
|
| | 7 | | namespace MRA.DTO.Mapper; |
| | 8 | |
|
| | 9 | | public class InspirationMapper : IDocumentMapper<InspirationModel, IInspirationDocument> |
| | 10 | | { |
| | 11 | | public InspirationModel ConvertToModel(IInspirationDocument drawingDocument) |
| | 12 | | { |
| 3 | 13 | | return new InspirationModel |
| 3 | 14 | | { |
| 3 | 15 | | Id = drawingDocument.Id, |
| 3 | 16 | | Name = drawingDocument.Name, |
| 3 | 17 | | Instagram = drawingDocument.Instagram, |
| 3 | 18 | | Type = (InspirationTypes) drawingDocument.Type, |
| 3 | 19 | | Twitter = drawingDocument.Twitter, |
| 3 | 20 | | YouTube = drawingDocument.YouTube, |
| 3 | 21 | | Twitch = drawingDocument.Twitch, |
| 3 | 22 | | Pinterest = drawingDocument.Pinterest, |
| 3 | 23 | | }; |
| | 24 | | } |
| | 25 | |
|
| | 26 | | public IInspirationDocument ConvertToDocument(InspirationModel drawing) |
| | 27 | | { |
| 0 | 28 | | return new InspirationMongoDocument |
| 0 | 29 | | { |
| 0 | 30 | | Id = drawing.Id, |
| 0 | 31 | | Name = drawing.Name, |
| 0 | 32 | | Instagram = drawing.Instagram, |
| 0 | 33 | | Twitter = drawing.Twitter, |
| 0 | 34 | | Type = (int) drawing.Type, |
| 0 | 35 | | YouTube = drawing.YouTube, |
| 0 | 36 | | Twitch = drawing.Twitch, |
| 0 | 37 | | Pinterest = drawing.Pinterest, |
| 0 | 38 | | }; |
| | 39 | | } |
| | 40 | | } |