title: Object Mapper class use to store data in Core Data
body: <p>Let start from background of my problem.</p>
  
  <p>I have a <code>Person</code> class which is used to parse <code>JSON</code> response</p>
  
  <pre><code>class Person: NSObject, Mappable {
  
          var ID : String?
          var firstName : String?
          var lastName : String?
  
          convenience required init?(map: Map) {
                  self.init()
  
              }
  
              func mapping(map: Map) {
                  patientsCount &lt;- map["patientsCount"]
                  status &lt;- map["status"]
                  message &lt;- map["Message"]
                  patientSearchArray &lt;- map["patientsList_JSON"]
              }
      }
  </code></pre>
  
  <p>While on the other I have another class names <code>PersonMO</code> which is used to save record in <code>CoreData</code></p>
  
  <pre><code>        @objc(Event)
          class PersonMO: NSManagedObject {
  
          @NSManaged var ID : String?
          @NSManaged var firstName : String?
          @NSManaged var lastName : String?
  
      }
  </code></pre>
  
  <p>Now comes to main point. The problem I am facing is that I have to create two different classes for one purpose. Just like When <code>JSON</code> comes form <code>Server Side</code> then I have to parse it into <code>Person</code> class and then I want to save that <code>Person</code> into <code>Core Data</code> for that I have to convert <code>Person</code> class object to <code>PersonMO</code> class object. Which seems like a bad practice. 
  Is there any way to use just one Class <code>Person</code> will be used to parse <code>JSON</code> and at the same time I want to use that <code>Person</code> class to store data in Core Data.</p>