Example #1
0
 public virtual void SyncFromModel(certification_category category)
 {
     StateAbbr = category.state;
     Name = category.name;
     Number = category.number;
 }
Example #2
0
        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;
        }