Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

Commit 747bebc

Browse files
Add UWP and update NuGets
1 parent 082d44f commit 747bebc

File tree

148 files changed

+30798
-6260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+30798
-6260
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ bld/
2020
[Bb]in/
2121
[Oo]bj/
2222
[Pp]ackages/
23+
.vs/
24+
*.pubxml
2325

2426
# MSTest test Results
2527
[Tt]est[Rr]esult*/

MyShopApp_Web/MyShopApp.sln renamed to Backend/myshoppe_demo.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
44
VisualStudioVersion = 12.0.21005.1
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyShopAppService", "MyShopAppService\MyShopAppService.csproj", "{209FA716-A7AD-4095-BD70-C8710FC66FA7}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "myshoppe_demoService", "myshoppe_demoService\myshoppe_demoService.csproj", "{209FA716-A7AD-4095-BD70-C8710FC66FA7}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data.Entity;
5+
using System.Web.Http;
6+
using Microsoft.Azure.Mobile.Server;
7+
using Microsoft.Azure.Mobile.Server.Authentication;
8+
using Microsoft.Azure.Mobile.Server.Config;
9+
using myshoppe_demoService.DataObjects;
10+
using myshoppe_demoService.Models;
11+
using Owin;
12+
13+
namespace myshoppe_demoService
14+
{
15+
public partial class Startup
16+
{
17+
public static void ConfigureMobileApp(IAppBuilder app)
18+
{
19+
HttpConfiguration config = new HttpConfiguration();
20+
21+
//For more information on Web API tracing, see http://go.microsoft.com/fwlink/?LinkId=620686
22+
config.EnableSystemDiagnosticsTracing();
23+
24+
new MobileAppConfiguration()
25+
.UseDefaultConfiguration()
26+
.ApplyTo(config);
27+
28+
// Use Entity Framework Code First to create database tables based on your DbContext
29+
Database.SetInitializer(new myshoppe_demoInitializer());
30+
31+
// To prevent Entity Framework from modifying your database schema, use a null database initializer
32+
// Database.SetInitializer<myshoppe_demoContext>(null);
33+
34+
MobileAppSettingsDictionary settings = config.GetMobileAppSettingsProvider().GetMobileAppSettings();
35+
36+
if (string.IsNullOrEmpty(settings.HostName))
37+
{
38+
// This middleware is intended to be used locally for debugging. By default, HostName will
39+
// only have a value when running in an App Service application.
40+
app.UseAppServiceAuthentication(new AppServiceAuthenticationOptions
41+
{
42+
SigningKey = ConfigurationManager.AppSettings["SigningKey"],
43+
ValidAudiences = new[] { ConfigurationManager.AppSettings["ValidAudience"] },
44+
ValidIssuers = new[] { ConfigurationManager.AppSettings["ValidIssuer"] },
45+
TokenHandler = config.GetAppServiceTokenHandler()
46+
});
47+
}
48+
app.UseWebApi(config);
49+
}
50+
}
51+
52+
public class myshoppe_demoInitializer : CreateDatabaseIfNotExists<myshoppe_demoContext>
53+
{
54+
protected override void Seed(myshoppe_demoContext context)
55+
{
56+
57+
58+
base.Seed(context);
59+
}
60+
}
61+
}
62+

MyShopApp_Web/MyShopAppService/Controllers/FeedbackController.cs renamed to Backend/myshoppe_demoService/Controllers/FeedbackController.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
using System.Web.Http.Controllers;
55
using System.Web.Http.OData;
66
using Microsoft.Azure.Mobile.Server;
7-
using Microsoft.Azure.Mobile.Server.AppService;
8-
using MyShopAppService.DataObjects;
9-
using MyShopAppService.Models;
7+
using myshoppe_demoService.DataObjects;
8+
using myshoppe_demoService.Models;
109

11-
namespace MyShopAppService.Controllers
10+
namespace myshoppe_demoService.Controllers
1211
{
1312
public class FeedbackController : TableController<Feedback>
1413
{
1514
protected override void Initialize(HttpControllerContext controllerContext)
1615
{
1716
base.Initialize(controllerContext);
18-
MyShopAppContext context = new MyShopAppContext();
19-
DomainManager = new EntityDomainManager<Feedback>(context, Request, Services);
17+
myshoppe_demoContext context = new myshoppe_demoContext();
18+
DomainManager = new EntityDomainManager<Feedback>(context, Request);
2019
}
2120

2221
// GET tables/Feedback
@@ -49,6 +48,5 @@ public Task DeleteFeedback(string id)
4948
{
5049
return DeleteAsync(id);
5150
}
52-
5351
}
54-
}
52+
}

MyShopApp_Web/MyShopAppService/Controllers/StoreController.cs renamed to Backend/myshoppe_demoService/Controllers/StoreController.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
using System.Web.Http.Controllers;
55
using System.Web.Http.OData;
66
using Microsoft.Azure.Mobile.Server;
7-
using Microsoft.Azure.Mobile.Server.AppService;
8-
using MyShopAppService.DataObjects;
9-
using MyShopAppService.Models;
7+
using myshoppe_demoService.DataObjects;
8+
using myshoppe_demoService.Models;
109

11-
namespace MyShopAppService.Controllers
10+
namespace myshoppe_demoService.Controllers
1211
{
1312
public class StoreController : TableController<Store>
1413
{
1514
protected override void Initialize(HttpControllerContext controllerContext)
1615
{
1716
base.Initialize(controllerContext);
18-
MyShopAppContext context = new MyShopAppContext();
19-
DomainManager = new EntityDomainManager<Store>(context, Request, Services);
17+
myshoppe_demoContext context = new myshoppe_demoContext();
18+
DomainManager = new EntityDomainManager<Store>(context, Request);
2019
}
2120

2221
// GET tables/Store
@@ -32,7 +31,7 @@ public SingleResult<Store> GetStore(string id)
3231
}
3332

3433
// PATCH tables/Store/48D68C86-6EA6-4C25-AA33-223FC9A27959
35-
public Task<Store> PatchStore(string id, Delta<Store> patch)
34+
/*public Task<Store> PatchStore(string id, Delta<Store> patch)
3635
{
3736
return UpdateAsync(id, patch);
3837
}
@@ -48,7 +47,6 @@ public async Task<IHttpActionResult> PostStore(Store item)
4847
public Task DeleteStore(string id)
4948
{
5049
return DeleteAsync(id);
51-
}
52-
50+
}*/
5351
}
54-
}
52+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Microsoft.Azure.Mobile.Server;
2+
using System;
3+
4+
namespace myshoppe_demoService.DataObjects
5+
{
6+
public class Feedback : EntityData
7+
{
8+
public string Text { get; set; }
9+
public DateTime FeedbackDate { get; set; }
10+
public DateTime VisitDate { get; set; }
11+
public int Rating { get; set; }
12+
public int ServiceType { get; set; }
13+
public string Name { get; set; }
14+
public string PhoneNumber { get; set; }
15+
public bool RequiresCall { get; set; }
16+
public string StoreName { get; set; }
17+
}
18+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using Microsoft.Azure.Mobile.Server;
2+
3+
4+
namespace myshoppe_demoService.DataObjects
5+
{
6+
public class Store : EntityData
7+
{
8+
public string Name { get; set; }
9+
public string LocationHint { get; set; }
10+
11+
public string StreetAddress { get; set; }
12+
public string City { get; set; }
13+
public string State { get; set; }
14+
public string ZipCode { get; set; }
15+
public string Image { get; set; }
16+
17+
public double Latitude { get; set; }
18+
public double Longitude { get; set; }
19+
20+
public string MondayOpen { get; set; }
21+
public string MondayClose { get; set; }
22+
public string TuesdayOpen { get; set; }
23+
public string TuesdayClose { get; set; }
24+
public string WednesdayOpen { get; set; }
25+
public string WednesdayClose { get; set; }
26+
public string ThursdayOpen { get; set; }
27+
public string ThursdayClose { get; set; }
28+
public string FridayOpen { get; set; }
29+
public string FridayClose { get; set; }
30+
public string SaturdayOpen { get; set; }
31+
public string SaturdayClose { get; set; }
32+
public string SundayOpen { get; set; }
33+
public string SundayClose { get; set; }
34+
35+
public string PhoneNumber { get; set; }
36+
37+
public string Country { get; set; }
38+
39+
public string LocationCode { get; set; }
40+
}
41+
}

MyShopApp_Web/MyShopAppService/Models/MyShopAppContext.cs renamed to Backend/myshoppe_demoService/Models/myshoppe_demoContext.cs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,36 @@
33
using System.Linq;
44
using Microsoft.Azure.Mobile.Server;
55
using Microsoft.Azure.Mobile.Server.Tables;
6-
using MyShopAppService.DataObjects;
6+
using myshoppe_demoService.DataObjects;
77

8-
namespace MyShopAppService.Models
8+
namespace myshoppe_demoService.Models
99
{
10-
public class MyShopAppContext : DbContext
10+
public class myshoppe_demoContext : DbContext
1111
{
1212
// You can add custom code to this file. Changes will not be overwritten.
1313
//
1414
// If you want Entity Framework to alter your database
1515
// automatically whenever you change your model schema, please use data migrations.
1616
// For more information refer to the documentation:
1717
// http://msdn.microsoft.com/en-us/data/jj591621.aspx
18-
//
19-
// To enable Entity Framework migrations in the cloud, please ensure that the
20-
// service name, set by the 'MS_MobileServiceName' AppSettings in the local
21-
// Web.config, is the same as the service name when hosted in Azure.
18+
2219
private const string connectionStringName = "Name=MS_TableConnectionString";
2320

24-
public MyShopAppContext() : base(connectionStringName)
21+
public myshoppe_demoContext() : base(connectionStringName)
2522
{
2623
}
2724

28-
25+
2926
protected override void OnModelCreating(DbModelBuilder modelBuilder)
3027
{
31-
string schema = ServiceSettingsDictionary.GetSchemaName();
32-
if (!string.IsNullOrEmpty(schema))
33-
{
34-
modelBuilder.HasDefaultSchema(schema);
35-
}
36-
3728
modelBuilder.Conventions.Add(
3829
new AttributeToColumnAnnotationConvention<TableColumnAttribute, string>(
3930
"ServiceTableColumn", (property, attributes) => attributes.Single().ColumnType.ToString()));
4031
}
4132

42-
public System.Data.Entity.DbSet<MyShopAppService.DataObjects.Feedback> Feedbacks { get; set; }
33+
public System.Data.Entity.DbSet<myshoppe_demoService.DataObjects.Feedback> Feedbacks { get; set; }
4334

44-
public System.Data.Entity.DbSet<MyShopAppService.DataObjects.Store> Stores { get; set; }
35+
public System.Data.Entity.DbSet<myshoppe_demoService.DataObjects.Store> Stores { get; set; }
4536
}
4637

4738
}

MyShopApp_Web/MyShopAppService/Properties/AssemblyInfo.cs renamed to Backend/myshoppe_demoService/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
8-
[assembly: AssemblyTitle("MyShopAppService")]
8+
[assembly: AssemblyTitle("myshoppe_demoService")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("MyShopAppService")]
12+
[assembly: AssemblyProduct("myshoppe_demoService")]
1313
[assembly: AssemblyCopyright("Copyright © 2014")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Microsoft.Owin;
2+
using Owin;
3+
4+
[assembly: OwinStartup(typeof(myshoppe_demoService.Startup))]
5+
6+
namespace myshoppe_demoService
7+
{
8+
public partial class Startup
9+
{
10+
public void Configuration(IAppBuilder app)
11+
{
12+
ConfigureMobileApp(app);
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)