Esempio n. 1
0
 public Core.Models.Comment Map(Comment source, User childSource)
 {
     return(new Core.Models.Comment()
     {
         PostId = source.PostId, User = userMapper.Map(childSource), Text = source.Text
     });
 }
Esempio n. 2
0
 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)));
        }
Esempio n. 4
0
        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"));
        }
Esempio n. 5
0
 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();
     }
 }
Esempio n. 6
0
 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();
     }
 }
Esempio n. 7
0
 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();
     }
 }
Esempio n. 8
0
 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();
     }
 }
Esempio n. 9
0
 public async Task <IEnumerable <SiteItem> > GetSiteItems()
 {
     return(await Task.Run(() => dbContext.All <Db.Entities.SiteItem>().Select(i => dbSiteItemMapper.Map(i)).ToList()));
 }
Esempio n. 10
0
 public void Add(SiteItem item)
 {
     dbContext.Add(coreSiteItemMapper.Map(item));
 }
Esempio n. 11
0
        public IEnumerable <Core.Models.PostSummary> GetPostSummaries()
        {
            IEnumerable <PostSummary> summaries = dbContext.GetPostSummaries();

            return(summaries.Select(x => postSummaryMapper.Map(x)).ToList());
        }