public void UpdateFacebookLeadGen(FacebookLeadGen fbLead) { if (fbLead != null) { var db = ObjectContextFactory.Create(); FacebookLeadGenDb leadGen = Mapper.Map <FacebookLeadGen, FacebookLeadGenDb>(fbLead); db.Entry(leadGen).State = EntityState.Modified; db.SaveChanges(); } }
public void InsertFacebookLeadGen(FacebookLeadGen fbLead) { if (fbLead != null) { var db = ObjectContextFactory.Create(); FacebookLeadGenDb leadGen = Mapper.Map <FacebookLeadGen, FacebookLeadGenDb>(fbLead); leadGen.CreatedDate = DateTime.UtcNow; db.FacebookLeadGen.Add(leadGen); db.SaveChanges(); } }