예제 #1
0
        public bool Create(Person person)
        {
            using (var db = _dbFactory.GetDatabase())
            using (var transaction = db.BeginTransaction())
            {
                try
                {
                    db.ExecuteWithTransaction(new CreatePersonCommand(person), transaction);
                    transaction.Commit();
                    return true;
                }
                catch (SqlException)
                {
                    transaction.Rollback();
                }
            }

            return false;
        }
 public CreatePersonCommand(Person person)
 {
     _person = person;
 }
 public UpdatePersonCommand(Guid personUid, Person person)
 {
     _personUid = personUid;
     _person = person;
 }