public void CreateCar()
 {
     FxCarContext context = new FxCarContext();
     var entity = new Entity.FxCar.CarTransferInfo()
     {
         Action = "Action",
         AreaId = 1,
         CarMileage = 232,
         CarYear = 1998,
         CatagroyId = 1,
         CityId = 1,
         Controller = "Controller",
         IsDelete = false,
         IsPublish = false,
         Mark = "Mark",
         Pictures = new System.Collections.Generic.List<Entity.TransferPicture>() { 
             new Entity.TransferPicture() { 
                  CdnUrl="CdnUrl", ImageUrl="CdnUrl", IsCdn=false, PhysicalPath="CdnUrl", TransferPictureCatagroy=2
             } 
         },
         Price = 1232,
         PublishTitle = "PublishTitle",
         PublishUserEmail = "PublishUserEmail",
         UserAccount = "UserAccount"
     };
     context.SaveChanges();
     context.CarTransferInfos.Remove(entity);
 }
Exemple #2
0
        public void CreateCar()
        {
            FxCarContext context = new FxCarContext();
            var          entity  = new Entity.FxCar.CarTransferInfo()
            {
                Action     = "Action",
                AreaId     = 1,
                CarMileage = 232,
                CarYear    = 1998,
                CatagroyId = 1,
                CityId     = 1,
                Controller = "Controller",
                IsDelete   = false,
                IsPublish  = false,
                Mark       = "Mark",
                Pictures   = new System.Collections.Generic.List <Entity.TransferPicture>()
                {
                    new Entity.TransferPicture()
                    {
                        CdnUrl = "CdnUrl", ImageUrl = "CdnUrl", IsCdn = false, PhysicalPath = "CdnUrl", TransferPictureCatagroy = 2
                    }
                },
                Price            = 1232,
                PublishTitle     = "PublishTitle",
                PublishUserEmail = "PublishUserEmail",
                UserAccount      = "UserAccount"
            };

            context.SaveChanges();
            context.CarTransferInfos.Remove(entity);
        }
Exemple #3
0
 /// <summary>
 /// 保存车辆转让信息
 /// </summary>
 /// <param name="car">车辆转让信息</param>
 /// <returns>是否保存成功</returns>
 public bool SaveTransferCar(Entity.FxCar.CarTransferInfo car)
 {
     using (FxCarContext context = new FxCarContext())
     {
         context.CarTransferInfos.Add(car);
         context.SaveChanges();
     }
     return(car.CarTransferInfoId > 0);
 }