public RealProperty(RealProperty realProperty) { Address = realProperty.Address; YearBuilt = realProperty.YearBuilt; ListPrice = realProperty.ListPrice; MonthlyRent = realProperty.MonthlyRent; }
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)); }
// 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); }
public RealProperty(RealProperty copySource) : base(copySource) { lBound = copySource.lBound; uBound = copySource.uBound; this.defaultValue = copySource.defaultValue; }