コード例 #1
0
ファイル: Program.cs プロジェクト: vermie/DataMapper
        static void TypeMapper()
        {
            var orderEntity = new OrderEntity();
            var addOrder = CreateNewOrderPoco();
            TypeMapStore tms = new TypeMapStore();

            tms.Define<OrderEntity, OrderPoco>()
                .MapProperty(a => a.OrderId, b => b.MyId)
                .MapProperty(a => a.Status, b => b.Status);
            //.MapRemainingByConvention(PropertyMapUnresolvedBehavior.None);

            tms.Define<LocalDataStoreSlot, Object>();

            tms.Define<TimeZone, Object>();

            tms.Finish();

            tms.Map<OrderPoco, OrderEntity>(addOrder, orderEntity);

            var yo = 34;
            //dataMapBlock.Delete(addFindResult);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: vermie/DataMapper
        static OrderEntity CreateNewOrderEntity()
        {
            OrderEntity newOrder = new OrderEntity()
            {
                Number = "4000" + Guid.NewGuid().ToString(),
                OrderDate = DateTime.Now,
                Status = (Int32)StatusEnum.Giggidy,
                TaxRate = (34.23m),
                ConcurrencyId = 0,
                OptionalNote = null,
                OptionalPrice = 123M,
                OrderItem = new List<OrderItemEntity>()
                        {
                            new OrderItemEntity() {
                                ConcurrencyId = 0,
                                HasSerialNumber = false,
                                SalePrice = 34.12M,
                                SerialNumber = "",
                                Upc = "MYUPC"
                            },
                            new OrderItemEntity() {
                                ConcurrencyId = 0,
                                HasSerialNumber = true,
                                SalePrice = 134.12M,
                                SerialNumber = "ASerialnumber",
                                Upc = "OHTERUPC"
                            }
                        },
                OrderInformation = new List<OrderInformationEntity>()
                {
                    new OrderInformationEntity()
                    {
                        TrackAmount = 100,
                        TrackDate = DateTime.Now,
                        TrackingNumber = "TRK100500"
                    },
                    new OrderInformationEntity()
                    {
                        TrackAmount = null,
                        TrackDate = null,
                        TrackingNumber = null
                    }
                }
            };

            return newOrder;
        }