Beispiel #1
0
 public Result Create(Config model)
 {
     try
     {
         _repo.Add(_mapper.Map <ConfigEntity>(model));
         return(Result.Success);
     }
     catch (Exception e)
     {
         log.AddException(e);
         return(Result.Failed);
     }
 }
Beispiel #2
0
 public Result Create(Video model)
 {
     try
     {
         var item = _mapper.Map <VideoEntity>(model);
         CreateEntity(item);
         return(Result.Success);
     }
     catch (Exception e)
     {
         _logger.AddException(e);
         return(Result.Failed);
     }
 }
Beispiel #3
0
        public Photo Get(string id)
        {
            try
            {
                var items = GetEntity(p => p.Id == id);
                return(_mapper.Map <Photo>(items));
            }
            catch (Exception e)
            {
                _logger.AddException(e);

                return(null);
            }
        }
Beispiel #4
0
        public Result Create(Page model)
        {
            try
            {
                var item = _mapper.Map <PageEntity>(model);

                if (IsAnyEntity(p => p.ShortName == model.ShortName))
                {
                    item.ShortName = model.ShortName + 1;
                }
                CreateEntity(item);
                return(Result.Success);
            }
            catch (Exception e)
            {
                _logger.AddException(e);
                return(Result.Failed);
            }
        }