public async Task <CreatePropertyPayload> CreateProperty(CreatePropertyInput input,
                                                                 [ScopedService] TenantFileContext context)

        {
            var property = new Property
            {
                Name = input.Name
                ,
                Address = new Address()
                {
                    City       = input.AddressInput.City,
                    PostalCode = input.AddressInput.PostalCode,
                    State      = input.AddressInput.State,
                    Line1      = input.AddressInput.Line1,
                    Line2      = input.AddressInput.Line2,
                    Line3      = input.AddressInput.Line3,
                    Line4      = input.AddressInput.Line4
                }
            };

            context.Properties.Add(property);
            await context.SaveChangesAsync();

            return(new CreatePropertyPayload(property));
        }
Example #2
0
        public async Task CreateProperty(CreatePropertyInput input)
        {
            var property = input.MapTo <Property>();
            var dataId   = await _propertyRepository.InsertAndGetIdAsync(property);

            _detailManager.Save(DetailType.Property, dataId, input.Content);
        }
Example #3
0
        public Property CreateProperty(CreatePropertyInput property)
        {
            Property newProperty = new Property
            {
                Id           = _propertyRepository.GetAll().Max(x => x.Id) + 1,
                Name         = property.Name,
                City         = property.City,
                Street       = property.Street,
                Spa          = property.Spa,
                SwimmingPool = property.SwimmingPool
            };

            return(_propertyRepository.Create(newProperty));
        }
        public Property CreateProperty(CreatePropertyInput property)
        {
            Property newProperty = new Property
            {
                _id          = ObjectId.GenerateNewId().ToString(),
                Name         = property.Name,
                City         = property.City,
                Street       = property.Street,
                Spa          = property.Spa,
                SwimmingPool = property.SwimmingPool,
            };

            return(_propertyRepository.Create(newProperty));
        }