예제 #1
0
        public override ResultOperation Save(Pet entity)
        {
            ResultOperation result = new ResultOperation();

            try
            {
                Repository.SavePet(entity);
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Errors.Add(ex.Message);
            }
            return(result);
        }
예제 #2
0
        public override ResultOperation Save(User entity)
        {
            ResultOperation result = new ResultOperation();

            try
            {
                if (entity.ChangePassword)
                {
                    entity.Password = GetPasswordHash(entity.Password);
                }

                Repository.SaveUser(entity);
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Errors.Add(ex.Message);
            }

            return(result);
        }