//For remove actor rating public bool RemoveActorRating(ActorRatingDto actorRatingDto) { var connection = (NpgsqlConnection)this.Database.GetDbConnection(); if (connection.State != ConnectionState.Open) { connection.Open(); } var command = connection.CreateCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "remove_user_rating_names"; command.Parameters.Add(new Npgsql.NpgsqlParameter("inputusername", NpgsqlTypes.NpgsqlDbType.Varchar) { Value = actorRatingDto.UserName }); command.Parameters.Add(new Npgsql.NpgsqlParameter("inputnconst", NpgsqlTypes.NpgsqlDbType.Varchar) { Value = actorRatingDto.PersonId }); var reader = command.ExecuteScalar(); return((bool)reader); }
public bool RemoveActorRating(ActorRatingDto actorRatingDto) { using (var ctx = new MoviesContext()) { return(ctx.RemoveActorRating(actorRatingDto)); } }
public IActionResult RemoveActorRating(ActorRatingDto actorRatingDto) { bool result = ds.RemoveActorRating(actorRatingDto); return(Ok(result)); }
public IActionResult AddActorRating(ActorRatingDto actorRatingDto) { bool result = ds.AddActorRating(actorRatingDto); return(Ok(result)); }