Esempio n. 1
0
        public async Task AddAsync(Entities.TvSerie entity)
        {
            var ex = await FindAsync(entity.Id);

            if (entity == null)
            {
                throw new NullReferenceException();
            }
            else if (!ex)
            {
                var command = "tvserie_save";
                var param   = new DynamicParameters();
                param.Add("@Id", entity.Id);
                param.Add("@title", entity.title);
                param.Add("@poster", entity.poster);
                param.Add("@voteAverage", entity.voteAverage);
                param.Add("@isPosted", entity.IsPosted);
                param.Add("@numberOfSeasons", entity.NumberOfSeasons);

                await connection.ExecuteAsync(command, param, transaction, commandType : CommandType.StoredProcedure);
            }
            else
            {
                //return new ResponseMessage("This TvSerie already exist in database.");
            }
        }
Esempio n. 2
0
        public void Remove(Entities.TvSerie entity)
        {
            string command = "tvserie_remove";
            var    param   = new DynamicParameters();

            param.Add("@Id", entity.Id);

            connection.Execute(command, param, transaction, commandType: CommandType.StoredProcedure);
        }