public bool UpdateWithStatus(EmployeeClassification classification)
        {
            if (classification == null)
            {
                throw new ArgumentNullException(nameof(classification), $"{nameof(classification)} is null.");
            }

            using (var db = new OrmCookbook())
            {
                return(1 == db.Update(classification));
            }
        }
Example #2
0
        public void Update(ReadOnlyEmployeeClassification classification)
        {
            if (classification == null)
            {
                throw new ArgumentNullException(nameof(classification), $"{nameof(classification)} is null.");
            }

            using (var db = new OrmCookbook())
            {
                db.Update(classification.ToEntity());
            }
        }
        public void UpdateOrException(EmployeeClassification classification)
        {
            if (classification == null)
            {
                throw new ArgumentNullException(nameof(classification), $"{nameof(classification)} is null.");
            }

            using (var db = new OrmCookbook())
            {
                var rowCount = db.Update(classification);
                if (rowCount != 1)
                {
                    throw new DataException($"No row was found for key {classification.EmployeeClassificationKey}.");
                }
            }
        }