Exemplo n.º 1
0
        private ShopHistoryDTO ToDTO(ShopHistoryEntity shopHistoryEntity)
        {
            ShopHistoryDTO shopHistoryDTO = new ShopHistoryDTO()
            {
                CardId   = shopHistoryEntity.CardId,
                Id       = shopHistoryEntity.Id,
                UserId   = shopHistoryEntity.UserId,
                UserName = shopHistoryEntity.User.UserName
            };

            return(shopHistoryDTO);
        }
Exemplo n.º 2
0
 public long InsertShopHistory(ShopHistoryDTO t_ShopHistory)
 {
     using (B2CDbContext ctx = new B2CDbContext())
     {
         ShopHistoryEntity shopHistoryEntity = new ShopHistoryEntity()
         {
             CardId = t_ShopHistory.CardId,
             UserId = t_ShopHistory.UserId
         };
         ctx.ShopHistories.Add(shopHistoryEntity);
         ctx.SaveChanges();
         return(shopHistoryEntity.Id);
     }
 }