View exception.cs
// In MainActivity
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
//TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException; ????
Xamarin.Forms.Forms.Init(this, bundle);
View controller.cs
using System.IO;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace EmbeddedResource.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
View itemgroup.xml
<ItemGroup>
<Content Remove="Data\fakedata.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Data\fakedata.json" />
</ItemGroup>
View embeddedresource.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Remove="Data\fakedata.json" />
</ItemGroup>
View super-siren.js
let Siren = require('super-siren');
let follow = Siren.Helper.follow;
let performAction = Siren.Helper.performAction;
Siren.get(uriOfTodoItem)
.then(performAction('complete'))
.then(res => {
/* Process Siren action HTTP response here */
});
View todo.cs
public class TodoConverter : IStateConverter
{
public Task<object> ConvertAsync(StateConverterContext context)
{
var urlHelper = context.HttpContext.RequestServices.GetRequiredService<IUrlHelper>();
var todo = context.Object as TodoModel;
var actions = new List<Siren.Core.Action>();
actions.Add(new Siren.Core.Action
View TodoCollectionConverter.cs
public class TodoCollectionConverter : IStateConverter
{
public Task<object> ConvertAsync(StateConverterContext context)
{
var todos = (context.Object as IEnumerable<TodoModel>);
var path = context.HttpContext.Request.GetDisplayUrl();
var properties = new
{
count = todos.Count()
View TodoController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
namespace Migrap.AspNetCore.Hateoas.Demo
{
[Route("api/[controller]")]
public class TodoController : Controller
{
View TodoModel.cs
using System;
namespace Migrap.AspNetCore.Hateoas.Demo
{
public class TodoModel
{
public Guid TodoId { get; set; }
public string Title { get; set; }
public bool IsCompleted { get; set; }
View httprequest.txt
POST: /books/add
Content-Type: application/x-www-form-urlencoded
title=The+Goal%3A+A+Process+of+Ongoing+Improvement&book_price=20.00