コード例 #1
0
ファイル: EFDataRepository.cs プロジェクト: inaumoski/sedc1
        public void Insert(BL.Models.Property p)
        {
            Property property = Property.MapFromBusinessModel(p);

            context.Properties.Add(property);
            context.SaveChanges();
        }
コード例 #2
0
ファイル: Property.cs プロジェクト: inaumoski/sedc1
        public BL.Models.Property MapToBusinessModel()
        {
            BL.Models.Property model = new BL.Models.Property
            {
                LocationAddress = this.LocationAddress,
                PriceRent       = this.PriceRent,
                PriceSale       = this.PriceSale,
                PropertyId      = this.PropertyId,
                SizeSqMeter     = this.SizeSqMeter,
            };

            return(model);
        }
コード例 #3
0
ファイル: Property.cs プロジェクト: inaumoski/sedc1
        public static Property MapFromBusinessModel(BL.Models.Property model)
        {
            Property p = new Property
            {
                SizeSqMeter     = model.SizeSqMeter,
                PropertyId      = model.PropertyId,
                PriceSale       = model.PriceSale,
                PriceRent       = model.PriceRent,
                LocationAddress = model.LocationAddress,
                IsDeleted       = false,
            };

            return(p);
        }