public Mapper() { mOurMapper = new OurMapper(new Dictionary <Type, Dictionary <string, Func <object, object> > > { { typeof(FileModelDto), new Dictionary <string, Func <object, object> > { { nameof(FileModelDto.FileBytes), (x) => (x as FileModel).File }, { nameof(FileModelDto.File), (x) => null } } }, { typeof(FileModel), new Dictionary <string, Func <object, object> > { { nameof(FileModel.ContentType), (x) => (x as FileModelDto).File == null || (x as FileModelDto).File.ContentType == null ? (x as FileModelDto).ContentType : (x as FileModelDto).File.ContentType }, { nameof(FileModel.File), (x) => (x as FileModelDto).FileBytes } } } }); }
public BooksRegistryService(IDocumentStore database, IOurMapper mapper) { _database = database; _mapper = mapper; }