private void Create(ParentalFacility entity)
        {
            var insert = $"INSERT INTO {TableName} " +
                         $"({nameof(ParentalFacility.Id)}, {nameof(ParentalFacility.Name)}, {nameof(ParentalFacility.Description)}, {nameof(ParentalFacility.Rating)}, {nameof(ParentalFacility.Latitude)}, {nameof(ParentalFacility.Longitude)}, {nameof(ParentalFacility.LastCleanedAt)}, " +
                         $"{nameof(ParentalFacility.Microwave)}, {nameof(ParentalFacility.ChangeTable)}, {nameof(ParentalFacility.RubbishBin)}, {nameof(ParentalFacility.Toilet)}, {nameof(ParentalFacility.Shower)}, {nameof(ParentalFacility.MusicPlayer)}, {nameof(ParentalFacility.HighChair)}, {nameof(ParentalFacility.SittingChair)}) " +
                         $"VALUES (${nameof(ParentalFacility.Id)}, ${nameof(ParentalFacility.Name)}, ${nameof(ParentalFacility.Description)}, ${nameof(ParentalFacility.Rating)}, ${nameof(ParentalFacility.Latitude)} , ${nameof(ParentalFacility.Longitude)}, ${nameof(ParentalFacility.LastCleanedAt)}, " +
                         $"${nameof(ParentalFacility.Microwave)}, ${nameof(ParentalFacility.ChangeTable)}, ${nameof(ParentalFacility.RubbishBin)}, ${nameof(ParentalFacility.Toilet)}, ${nameof(ParentalFacility.Shower)}, ${nameof(ParentalFacility.MusicPlayer)}, ${nameof(ParentalFacility.HighChair)}, ${nameof(ParentalFacility.SittingChair)})";
            var cmd = new SqliteCommand(insert, _connection);

            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Id)}", entity.Id);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Name)}", entity.Name);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Description)}", entity.Description);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Rating)}", entity.Rating);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Latitude)}", entity.Latitude);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Longitude)}", entity.Longitude);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.LastCleanedAt)}", entity.LastCleanedAt.ToString());
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Microwave)}", entity.Microwave);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.ChangeTable)}", entity.ChangeTable);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.RubbishBin)}", entity.RubbishBin);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Toilet)}", entity.Toilet);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.Shower)}", entity.Shower);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.MusicPlayer)}", entity.MusicPlayer);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.HighChair)}", entity.HighChair);
            cmd.Parameters.AddWithValue($"${nameof(ParentalFacility.SittingChair)}", entity.SittingChair);

            cmd.ExecuteScalar();
        }
Exemplo n.º 2
0
 public ParentalFacilityDto Map(ParentalFacility input)
 {
     return(_mapper.Map <ParentalFacilityDto>(input));
 }