public virtual void SyncFromModel(certification_category category) { StateAbbr = category.state; Name = category.name; Number = category.number; }
public certification_category UpsertCertificationCategory(certification_category category) { CertificationCategory cat; if (!category.id.IsNullOrEmpty()) { cat = _entityRepository.GetByID<CertificationCategory>(category.id); if (cat == null) throw new NullReferenceException("Specified certification category not found."); } else cat = new CertificationCategory(); cat.SyncFromModel(category); _entityRepository.Save(cat); return cat; }