| | 1 | | using MRA.DTO.Mapper.Interfaces; |
| | 2 | | using MRA.DTO.Models; |
| | 3 | | using MRA.Infrastructure.Database.Documents.Interfaces; |
| | 4 | | using MRA.Infrastructure.Database.Documents.MongoDb; |
| | 5 | |
|
| | 6 | | namespace MRA.DTO.Mapper; |
| | 7 | |
|
| | 8 | | public class CollectionMapper : IDocumentMapper<CollectionModel, ICollectionDocument> |
| | 9 | | { |
| | 10 | | public CollectionModel ConvertToModel(ICollectionDocument collectionDocument) |
| | 11 | | { |
| 0 | 12 | | return new CollectionModel |
| 0 | 13 | | { |
| 0 | 14 | | Id = collectionDocument.Id, |
| 0 | 15 | | Name = collectionDocument.name, |
| 0 | 16 | | Description = collectionDocument.description, |
| 0 | 17 | | Order = collectionDocument.order, |
| 0 | 18 | | DrawingIds = collectionDocument.drawingIds |
| 0 | 19 | | }; |
| | 20 | | } |
| | 21 | |
|
| | 22 | | public ICollectionDocument ConvertToDocument(CollectionModel collection) |
| | 23 | | { |
| 0 | 24 | | return new CollectionMongoDocument |
| 0 | 25 | | { |
| 0 | 26 | | Id = collection.Id, |
| 0 | 27 | | name = collection.Name, |
| 0 | 28 | | description = collection.Description, |
| 0 | 29 | | order = collection.Order, |
| 0 | 30 | | drawingIds = collection.DrawingIds |
| 0 | 31 | | }; |
| | 32 | | } |
| | 33 | | } |