public Result Create(Config model) { try { _repo.Add(_mapper.Map <ConfigEntity>(model)); return(Result.Success); } catch (Exception e) { log.AddException(e); return(Result.Failed); } }
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); } }
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); } }
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); } }