public Core.Models.Comment Map(Comment source, User childSource) { return(new Core.Models.Comment() { PostId = source.PostId, User = userMapper.Map(childSource), Text = source.Text }); }
public Core.Models.Post Map(Post source, User childSource) { return(new Core.Models.Post() { Id = source.Id, Body = source.Body, Title = source.Title, User = userMapper.Map(childSource) }); }
public async Task <IEnumerable <RoadDto> > GetRoadStatusDetail(string roadName) { var road = await CallApi(roadName); return(road .Select(x => _mapper.Map(x))); }
public int Insert(GroupSaleVehicle poco, IDbConnection connection) { var dynamicParams = new DynamicParameters(mapper.Map(poco)); dynamicParams.Add("@VehicleID", dbType: DbType.Int32, direction: ParameterDirection.Output); connection.Execute("InsertSaleVehicle7", dynamicParams, commandType: CommandType.StoredProcedure); return(dynamicParams.Get <int>("@VehicleID")); }
public IEnumerable <Entities.User> GetUsers() { try { Database db = dataBaseFactory.Create(); IEnumerable <User> result = db.GetUsers(); return(result.Select(x => userMapper.Map(x)).ToList()); } catch (Exception) { throw new ConnectionTimeoutException(); } }
public IEnumerable <Entities.PostSummary> GetPostSummaries() { try { Database db = dataBaseFactory.Create(); IEnumerable <PostSummary> result = db.GetPostSummaries(); return(result.Select(x => postSummaryMapper.Map(x)).ToList()); } catch (Exception) { throw new ConnectionTimeoutException(); } }
public Entities.Post GetPost(int postId) { try { Database db = dataBaseFactory.Create(); Post result = db.GetPost(postId); return(postMapper.Map(result)); } catch (Exception) { throw new ConnectionTimeoutException(); } }
public IList <Entities.Comment> GetComments(int postId) { try { Database db = dataBaseFactory.Create(); IList <Comment> result = db.GetComments(postId); return(result.Select(x => commentMapper.Map(x)).ToList()); } catch (Exception) { throw new ConnectionTimeoutException(); } }
public async Task <IEnumerable <SiteItem> > GetSiteItems() { return(await Task.Run(() => dbContext.All <Db.Entities.SiteItem>().Select(i => dbSiteItemMapper.Map(i)).ToList())); }
public void Add(SiteItem item) { dbContext.Add(coreSiteItemMapper.Map(item)); }
public IEnumerable <Core.Models.PostSummary> GetPostSummaries() { IEnumerable <PostSummary> summaries = dbContext.GetPostSummaries(); return(summaries.Select(x => postSummaryMapper.Map(x)).ToList()); }