Esempio n. 1
0
        public UserProducts AddUserProducts(AddUserProductsCommand newUserProducts)
        {
            using (var connection = new SqlConnection(_connectionString))
            {
                connection.Open();

                var sql = @"INSERT INTO [dbo].[UserProducts]
	                                ([ProductId]
	                                ,[UserId])
                                 output inserted.*
                                 VALUES
	                                (@ProductId
                                    ,@UserId)";


                return(connection.QueryFirst <UserProducts>(sql, newUserProducts));
            }
        }
Esempio n. 2
0
        public void Create(AddUserProductsCommand newUserProducts)
        {
            var repo = new UserProductsRepository();

            repo.AddUserProducts(newUserProducts);
        }