Ejemplo n.º 1
0
 public RealProperty(RealProperty realProperty)
 {
     Address     = realProperty.Address;
     YearBuilt   = realProperty.YearBuilt;
     ListPrice   = realProperty.ListPrice;
     MonthlyRent = realProperty.MonthlyRent;
 }
Ejemplo n.º 2
0
        public async Task <ActionResult <RealProperty> > CreateRealProperty(RealProperty realProperty)
        {
            var property = await _realPropertyService.CreateRealPropertyAsync(realProperty);

            if (property == null)
            {
                return(BadRequest(new ApiResponse(400, "Problem creating property")));
            }

            return(Ok(property));
        }
Ejemplo n.º 3
0
        // This method is responsible for creating a property inside the database.
        public async Task <RealProperty> CreateRealPropertyAsync(RealProperty realProperty)
        {
            // create RealProperty
            var realPropertyToCreate = new RealProperty(realProperty);

            _unitOfWork.Repository <RealProperty>().Add(realPropertyToCreate);

            // save to db
            var result = await _unitOfWork.Complete();

            if (result <= 0)
            {
                return(null);
            }

            // return RealProperty
            return(realPropertyToCreate);
        }
Ejemplo n.º 4
0
 public RealProperty(RealProperty copySource) : base(copySource)
 {
     lBound            = copySource.lBound;
     uBound            = copySource.uBound;
     this.defaultValue = copySource.defaultValue;
 }