Azure Mobile Services, Part 3: Listing 1

Del operation script with push notification.

function del(id, user, request) {
  var item = null;
  var sql = "SELECT * FROM ContactItem WHERE userId = ?";
    mssql.query(sql, [user.userId], {
        success: function(results) {
            if (results.length > 0) {
                 item = results[0];
            }
        }
    });
    
   request.execute({
        success: function() {
            request.respond();
            push.wns.sendToastText04(item.PushChannel, {
                text1: item.FirstName + " " + item.LastName + " was removed as a contact!"
            });
        }
    });
}

About the Author

Eric Vogel is a Senior Software Developer for Red Cedar Solutions Group in Okemos, Michigan. He is the president of the Greater Lansing User Group for .NET. Eric enjoys learning about software architecture and craftsmanship, and is always looking for ways to create more robust and testable applications. Contact him at [email protected].

comments powered by Disqus

Featured

  • Get Up and Running with Modern Angular

    The Angular web-dev framework might seem an odd choice for a Microsoft-centric developer to consider, seeing as it's championed by arch-rival Google, but a closer look reveals many advantages.

  • VS Code Experiments Boost AI Copilot Functionality

    Devs can now customize code generation, enjoy enhanced Chat experiences and much more.

  • AdaBoost Binary Classification Using C#

    Dr. James McCaffrey from Microsoft Research presents a C# program that illustrates using the AdaBoost algorithm to perform binary classification for spam detection. Compared to other classification algorithms, AdaBoost is powerful and works well with small datasets, but is sometimes susceptible to model overfitting.

  • From Core to Containers to Orchestration: Modernizing Your Azure Compute

    The cloud changed IT forever. And then containers changed the cloud. And then Kubernetes changed containers. And then microservices usurped monoliths, and so it goes in the cloudscape. Here's help to sort it all out.

Subscribe on YouTube