public async Task <int> CreateToilet(ToiletsBerlinModel toiletsBerlinModel) { DynamicParameters p = new DynamicParameters(); p.Add("Street", toiletsBerlinModel.Street); p.Add("PostalCode", toiletsBerlinModel.PostalCode); p.Add("Price", toiletsBerlinModel.Price); p.Add("City", toiletsBerlinModel.City); p.Add("hasChangingTable", toiletsBerlinModel.HasChangingTable); p.Add("isHandicappedAccessible", toiletsBerlinModel.IsHandycappedAccessible); p.Add("Latitude", toiletsBerlinModel.Latitude); p.Add("Longitude", toiletsBerlinModel.Longitude); p.Add("Id", DbType.Int32, direction: ParameterDirection.Output); await _dataAccess.SaveData("dbo.spToilet_Insert", p, _connectionString.SqlConnectionName); return(p.Get <int>("Id")); }
public async Task OnGet() { Toilet = await _toiletsBerlinData.GetToiletById(Id); }