Skip to content

Instantly share code, notes, and snippets.

View winstongubantes's full-sized avatar

Winston Gubantes winstongubantes

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace TravelAppMobile.Models
{
public class MessageSet
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp"
x:Class="MyApp.MainPage">
<ContentPage.Content>
<Grid>
<Image Source="background.png" Aspect="AspectFill"></Image>
<? xml version = "1.0" encoding = "utf-8" ?>
< !--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301879
-->
< configuration >
< appSettings >
< !--update these with your appid and one of your appsecret keys-->
< add key = "MicrosoftAppId" value = "[GUID]" />
< add key = "MicrosoftAppPassword" value = "[PASSWORD]" />
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.FormFlow;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
using Microsoft.Bot.Builder.Resource;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.FormFlow;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
using Microsoft.Bot.Builder.Resource;
@winstongubantes
winstongubantes / Messagescontroller.cs
Last active February 1, 2017 14:09
MessageController
[BotAuthentication]
public class MessagesController : ApiController
{
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
if (activity.Type == ActivityTypes.Message)
{
// calculate something for us to return
int length = (activity.Text ?? string.Empty).Length;