Skip to content

Commit

Permalink
resolving #1, #2, #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Fowler committed Apr 23, 2015
1 parent c8bf059 commit ea54200
Show file tree
Hide file tree
Showing 14 changed files with 269 additions and 35 deletions.
3 changes: 2 additions & 1 deletion azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"defaultValue": "master"
},
"sqlServerName": {
"type": "string"
"type": "string",
"defaultValue": "todo-db"
},
"sqlServerLocation": {
"type": "string"
Expand Down
2 changes: 0 additions & 2 deletions src/MultiChannelToDo.Web/MultiChannelToDo.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
<Content Include="app\lib\bootstrap\fonts\glyphicons-halflings-regular.ttf" />
<Content Include="app\lib\bootstrap\fonts\glyphicons-halflings-regular.woff" />
<Content Include="app\lib\bootstrap\fonts\glyphicons-halflings-regular.woff2" />
<Content Include="package.json" />
<Content Include="bower.json" />
<None Include="Properties\PublishProfiles\cf-todo.pubxml" />
<None Include="Properties\PublishProfiles\cf-todoapp.pubxml" />
<None Include="Properties\PublishProfiles\donnam-multichannel-webapp.pubxml" />
Expand Down
7 changes: 3 additions & 4 deletions src/MultiChannelToDo.Web/app/js/services/ToDoService.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
'use strict';
var apiPath = "https://donnam-multichannel.azurewebsites.net";
multiChannelToDoApp
.factory('toDoService', ['$http', function ($http) {
return {

getItems: function () {
return $http.get(apiPath + '/api/ToDoItems');
return $http.get(apiPath + '/ToDoItems');
},

add: function (id, task) {
return $http.post(apiPath + '/api/ToDoItems', { "Id": id + 1, "Text": task, "Complete": false });
return $http.post(apiPath + '/ToDoItems', { "Id": id + 1, "Text": task, "Complete": false });
},

complete: function (item) {
return $http.put(apiPath + '/api/ToDoItems/' + item.Id, { "Id": item.Id, "Text": item.Text, "Complete": true });
return $http.put(apiPath + '/ToDoItems/' + item.Id, { "Id": item.Id, "Text": item.Text, "Complete": true });
}
}
}]);
10 changes: 0 additions & 10 deletions src/MultiChannelToDo.Web/bower.json

This file was deleted.

15 changes: 0 additions & 15 deletions src/MultiChannelToDo.Web/package.json

This file was deleted.

6 changes: 5 additions & 1 deletion src/MultiChannelToDo/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Web.Http;
using System.Web.Http.Cors;
using System.Configuration;

namespace MultiChannelToDo
{
Expand All @@ -15,7 +16,10 @@ public static void Register(HttpConfiguration config)
new { id = RouteParameter.Optional }
);

config.EnableCors(new EnableCorsAttribute("*", "*", "*", "*"));
AppSettingsReader reader = new AppSettingsReader();
string clientUrl = reader.GetValue("clientUrl", typeof(string)).ToString();

config.EnableCors(new EnableCorsAttribute(clientUrl, "*", "*", "*"));
}
}
}
1 change: 0 additions & 1 deletion src/MultiChannelToDo/Controllers/ToDoItemsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace MultiChannelToDo.Controllers
{
[EnableCors("*", "*", "*", SupportsCredentials = false)]
public class ToDoItemsController : ApiController
{
private MultiChannelToDoContext db = new MultiChannelToDoContext();
Expand Down
1 change: 1 addition & 0 deletions src/MultiChannelToDo/Global.asax.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Cors;

namespace MultiChannelToDo
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace MultiChannelToDo.Migrations
{
using System;
using System.Data.Entity.Migrations;

public partial class InitializeDatabase : DbMigration
{
public override void Up()
{
CreateTable(
"mobile_service_name.TodoItems",
c => new
{
Id = c.String(nullable: false, maxLength: 128),
Text = c.String(),
Complete = c.Boolean(nullable: false),
CreatedAt = c.DateTimeOffset(precision: 7),
UpdatedAt = c.DateTimeOffset(precision: 7),
Deleted = c.Boolean(nullable: false),
})
.PrimaryKey(t => t.Id);

}

public override void Down()
{
DropTable("mobile_service_name.TodoItems");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAM1YzW7jNhC+F+g7CDq1QNZMsoemgbyLrJwUQddxsHL2uqClkU2UIlWSMuxn66GP1Ffo0Po15d9kURS+WMOZjzPDmY8j/fPX38HHVca9JSjNpBj6V4NL3wMRy4SJ+dAvTPruxv/44ccfgvskW3lfa733Vg8thR76C2PyW0J0vICM6kHGYiW1TM0glhmhiSTXl5e/kqsrAgjhI5bnBV8KYVgGmwd8DKWIITcF5WOZANeVHFeiDar3RDPQOY1h6I8Lbli4oEIAn8qRHJQmvnfHGUV3IuCp7+GyNNSgs7cvGiKjpJhHOQoon65zQL2Ucg1VELet+qnxXF7beEhrWEPFhTYyOxPw6n2VIOKavyrNfpNATOE9ptqsbdSbNA79qUzko4HM99zNbkOurOLeLA9q2wvP1bhoqgOLyP4uvBBVCgVDAYVRlF94z8WMs/h3WE/lHyCGouC86yo6i2tbAhQ9K5mDMusvkFYBPCa+R7btiGvYmHVsytCwGLC4fW9MV59BzM0Cy/76xvce2AqSWlJVx4tg2AtoZFSBj0/oMJ1xaNbJwT2nsDIHdsW/J+16eJNQZjkHA/VGn6TkQMXZzoYKqIHkrvF4hI9TbNJJmmowx8xf8uQt5iOwMSTnBRGQtrb7FY+kYigToKot3IK165sD6nUBMkbVCLo6g23fS/wITNNQo01TIAm1DpVMNGibbZfnjY8t45GS8mpqJHu4MRjTPMeK6nBlJfGikijDd9H55JGVGCTWOzik8bbZyUhF5+Cs2ppM4IEpbbAI6IzacwuTrKe270T2ZLve1U26SxjtGdQW9v/uInB5zQVr0/qAkWYgzCZoaJzq0GnPdHN/UU7VDi4KJS8ysY/PDlmXrNK1LyWnI7SU0UVppWcgtaSxBdWKT8fqMEgXqyM+Hauhky5SI+zjBMQ5ZbemSK+onPvHrdJDze6qNLs3Te80d1A12vHpqNd5pYrvYYKWLLFdF601VuvAKgyiP3nIGcbbKoypYCloU17RPhLDjTNb/X/mHKJ1wk8cdv7zOUMsqYoXVPUnjTeMETXoTxld/dxFes2oMGPm7WOC7U47y8vqnn9WELPyLeGXcx3sDRHfE9wZMY4Hf9540b/zjg0N9WBwYGYou3foZ3LGOHzToJYshm8CETCO0vNaW796xOizS0C6b2jBCDSbtxD2fU1AbNu2Ba11HkUq68xjtF2PahXnYMZgKB40vVOGpTQ2uByD1ptx+SvlBarcZzNIHsWkMHlh7rSGbMbX3XgDcnj/zRy17XMwye2T/h4hoJvM1upEfCoYTxq/H3ZU1R4IWz+/Aco3dIivCwg3XzdIT1KcCFSlbwQ5iASpfQrY9QimJyKiS3iNbzgQf4Y5jdf1JbEf5PhBbKc9GDE6VzTTFUZrb786EPvZ4cO/tFgGF6gQAAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>mobile_service_name</value>
</data>
</root>
58 changes: 58 additions & 0 deletions src/MultiChannelToDo/Migrations/Configuration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
namespace MultiChannelToDo.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using MultiChannelToDo.Models;
using System.Collections.Generic;

internal sealed class Configuration : DbMigrationsConfiguration<MultiChannelToDo.Models.MultiChannelToDoContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
}

protected override void Seed(MultiChannelToDo.Models.MultiChannelToDoContext context)
{
context.ToDoItems.AddRange(new List<TodoItem> {
new TodoItem
{
Id = Guid.NewGuid().ToString(),
Text = "Build Sample",
Complete = false,
Deleted = false,
UpdatedAt = DateTimeOffset.UtcNow,
CreatedAt = DateTimeOffset.UtcNow
},
new TodoItem
{
Id = Guid.NewGuid().ToString(),
Text = "Create ARM Template",
Complete = false,
Deleted = false,
UpdatedAt = DateTimeOffset.UtcNow,
CreatedAt = DateTimeOffset.UtcNow
},
new TodoItem
{
Id = Guid.NewGuid().ToString(),
Text = "Publish to Azure",
Complete = false,
Deleted = false,
UpdatedAt = DateTimeOffset.UtcNow,
CreatedAt = DateTimeOffset.UtcNow
},
new TodoItem
{
Id = Guid.NewGuid().ToString(),
Text = "Make Money",
Complete = false,
Deleted = false,
UpdatedAt = DateTimeOffset.UtcNow,
CreatedAt = DateTimeOffset.UtcNow
}});
}
}
}
10 changes: 10 additions & 0 deletions src/MultiChannelToDo/MultiChannelToDo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Migrations\201504231007334_Initialize Database.cs" />
<Compile Include="Migrations\201504231007334_Initialize Database.Designer.cs">
<DependentUpon>201504231007334_Initialize Database.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Models\TodoItem.cs" />
<Compile Include="Models\MultiChannelToDoContext.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand All @@ -140,6 +145,11 @@
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Migrations\201504231007334_Initialize Database.resx">
<DependentUpon>201504231007334_Initialize Database.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
6 changes: 5 additions & 1 deletion src/MultiChannelToDo/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
</configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<appSettings>
<add key="clientUrl" value=""/>
</appSettings>
<connectionStrings>
<add name="MultiChannelToDoContext" connectionString="" providerName="System.Data.SqlClient" />
</connectionStrings>
Expand Down

0 comments on commit ea54200

Please sign in to comment.