diff options
76 files changed, 568 insertions, 601 deletions
diff --git a/ApartmentAdmin b/ApartmentAdmin deleted file mode 160000 -Subproject da22548164ed3a3a9b89f25b31780c35a89a3b3 diff --git a/ApartmentManager/ApartmentManager.sln b/ApartmentManager/ApartmentManager.sln index 97a72ca..031a632 100644 --- a/ApartmentManager/ApartmentManager.sln +++ b/ApartmentManager/ApartmentManager.sln @@ -1,11 +1,11 @@    Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.26403.7  MinimumVisualStudioVersion = 10.0.40219.1  Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApartmentManager", "ApartmentManager\ApartmentManager.csproj", "{95401ED6-D03C-417D-8897-81B5454D2426}"  EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HousingWebAPI", "HousingWebAPI\HousingWebAPI.csproj", "{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HousingWebApi", "HousingWebApi\HousingWebApi.csproj", "{D777744A-9676-4193-BD59-6F30C724C87A}"  EndProject  Global  	GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -39,22 +39,22 @@ Global  		{95401ED6-D03C-417D-8897-81B5454D2426}.Release|x86.ActiveCfg = Release|x86  		{95401ED6-D03C-417D-8897-81B5454D2426}.Release|x86.Build.0 = Release|x86  		{95401ED6-D03C-417D-8897-81B5454D2426}.Release|x86.Deploy.0 = Release|x86 -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|Any CPU.Build.0 = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|ARM.ActiveCfg = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|ARM.Build.0 = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|x64.ActiveCfg = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|x64.Build.0 = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|x86.ActiveCfg = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Debug|x86.Build.0 = Debug|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|Any CPU.ActiveCfg = Release|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|Any CPU.Build.0 = Release|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|ARM.ActiveCfg = Release|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|ARM.Build.0 = Release|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|x64.ActiveCfg = Release|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|x64.Build.0 = Release|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|x86.ActiveCfg = Release|Any CPU -		{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}.Release|x86.Build.0 = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|Any CPU.Build.0 = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|ARM.ActiveCfg = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|ARM.Build.0 = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|x64.ActiveCfg = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|x64.Build.0 = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|x86.ActiveCfg = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Debug|x86.Build.0 = Debug|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|Any CPU.ActiveCfg = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|Any CPU.Build.0 = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|ARM.ActiveCfg = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|ARM.Build.0 = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|x64.ActiveCfg = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|x64.Build.0 = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|x86.ActiveCfg = Release|Any CPU +		{D777744A-9676-4193-BD59-6F30C724C87A}.Release|x86.Build.0 = Release|Any CPU  	EndGlobalSection  	GlobalSection(SolutionProperties) = preSolution  		HideSolutionNode = FALSE diff --git a/ApartmentManager/HousingWebAPI/App_Start/BundleConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/BundleConfig.cs index 12902e6..3c08fb2 100644 --- a/ApartmentManager/HousingWebAPI/App_Start/BundleConfig.cs +++ b/ApartmentManager/HousingWebAPI/App_Start/BundleConfig.cs @@ -1,18 +1,18 @@  using System.Web;  using System.Web.Optimization; -namespace HousingWebAPI +namespace HousingWebApi  {      public class BundleConfig      { -        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 +        // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862          public static void RegisterBundles(BundleCollection bundles)          {              bundles.Add(new ScriptBundle("~/bundles/jquery").Include(                          "~/Scripts/jquery-{version}.js"));              // Use the development version of Modernizr to develop with and learn from. Then, when you're -            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. +            // ready for production, use the build tool at https://modernizr.com to pick only the tests you need.              bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(                          "~/Scripts/modernizr-*")); diff --git a/ApartmentManager/HousingWebAPI/App_Start/FilterConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/FilterConfig.cs index cc37135..0761bdd 100644 --- a/ApartmentManager/HousingWebAPI/App_Start/FilterConfig.cs +++ b/ApartmentManager/HousingWebAPI/App_Start/FilterConfig.cs @@ -1,7 +1,7 @@  using System.Web;  using System.Web.Mvc; -namespace HousingWebAPI +namespace HousingWebApi  {      public class FilterConfig      { diff --git a/ApartmentManager/HousingWebAPI/App_Start/RouteConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/RouteConfig.cs index 6440cfb..73807c8 100644 --- a/ApartmentManager/HousingWebAPI/App_Start/RouteConfig.cs +++ b/ApartmentManager/HousingWebAPI/App_Start/RouteConfig.cs @@ -5,7 +5,7 @@ using System.Web;  using System.Web.Mvc;  using System.Web.Routing; -namespace HousingWebAPI +namespace HousingWebApi  {      public class RouteConfig      { diff --git a/ApartmentManager/HousingWebAPI/App_Start/WebApiConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/WebApiConfig.cs index a49bdaf..54dcdcc 100644 --- a/ApartmentManager/HousingWebAPI/App_Start/WebApiConfig.cs +++ b/ApartmentManager/HousingWebAPI/App_Start/WebApiConfig.cs @@ -3,7 +3,7 @@ using System.Collections.Generic;  using System.Linq;  using System.Web.Http; -namespace HousingWebAPI +namespace HousingWebApi  {      public static class WebApiConfig      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ApiDescriptionExtensions.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ApiDescriptionExtensions.cs index 83077cb..e46eff1 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ApiDescriptionExtensions.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ApiDescriptionExtensions.cs @@ -3,7 +3,7 @@ using System.Text;  using System.Web;  using System.Web.Http.Description; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      public static class ApiDescriptionExtensions      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/App_Start/HelpPageConfig.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/App_Start/HelpPageConfig.cs index 7044013..b568bab 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/App_Start/HelpPageConfig.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/App_Start/HelpPageConfig.cs @@ -16,7 +16,7 @@ using System.Web.Http;  using System.Web.Http.OData;  #endif -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// Use this class to customize the Help Page. @@ -26,7 +26,7 @@ namespace HousingWebAPI.Areas.HelpPage      public static class HelpPageConfig      {          [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", -            MessageId = "HousingWebAPI.Areas.HelpPage.TextSample.#ctor(System.String)", +            MessageId = "HousingWebApi.Areas.HelpPage.TextSample.#ctor(System.String)",              Justification = "End users may choose to merge this string with existing localized resources.")]          [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly",              MessageId = "bsonspec", diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Controllers/HelpController.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Controllers/HelpController.cs index 36674bc..c47338a 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Controllers/HelpController.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Controllers/HelpController.cs @@ -1,10 +1,10 @@  using System;  using System.Web.Http;  using System.Web.Mvc; -using HousingWebAPI.Areas.HelpPage.ModelDescriptions; -using HousingWebAPI.Areas.HelpPage.Models; +using HousingWebApi.Areas.HelpPage.ModelDescriptions; +using HousingWebApi.Areas.HelpPage.Models; -namespace HousingWebAPI.Areas.HelpPage.Controllers +namespace HousingWebApi.Areas.HelpPage.Controllers  {      /// <summary>      /// The controller that will handle requests for the help page. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageAreaRegistration.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageAreaRegistration.cs index a3c0ce1..a513a84 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageAreaRegistration.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageAreaRegistration.cs @@ -1,7 +1,7 @@  using System.Web.Http;  using System.Web.Mvc; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      public class HelpPageAreaRegistration : AreaRegistration      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageConfigurationExtensions.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageConfigurationExtensions.cs index f384280..29b8681 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageConfigurationExtensions.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/HelpPageConfigurationExtensions.cs @@ -11,10 +11,10 @@ using System.Net.Http.Headers;  using System.Web.Http;  using System.Web.Http.Controllers;  using System.Web.Http.Description; -using HousingWebAPI.Areas.HelpPage.ModelDescriptions; -using HousingWebAPI.Areas.HelpPage.Models; +using HousingWebApi.Areas.HelpPage.ModelDescriptions; +using HousingWebApi.Areas.HelpPage.Models; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      public static class HelpPageConfigurationExtensions      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs index e8f0753..129a217 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class CollectionModelDescription : ModelDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs index 4e4c31a..9da4aa0 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs @@ -1,6 +1,6 @@  using System.Collections.ObjectModel; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class ComplexTypeModelDescription : ModelDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs index 4d86e57..1592a36 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class DictionaryModelDescription : KeyValuePairModelDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs index 9d23179..a744547 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs @@ -1,7 +1,7 @@  using System.Collections.Generic;  using System.Collections.ObjectModel; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class EnumTypeModelDescription : ModelDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs index 7dbcb25..6345d92 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class EnumValueDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs index 95151dd..b9c6e5c 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs @@ -1,7 +1,7 @@  using System;  using System.Reflection; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public interface IModelDocumentationProvider      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs index 37d227f..46dd88b 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class KeyValuePairModelDescription : ModelDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs index 6d44857..c452165 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs @@ -1,6 +1,6 @@  using System; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      /// <summary>      /// Describes a type model. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescriptionGenerator.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescriptionGenerator.cs index c016a31..da19e51 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescriptionGenerator.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelDescriptionGenerator.cs @@ -11,7 +11,7 @@ using System.Web.Http.Description;  using System.Xml.Serialization;  using Newtonsoft.Json; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      /// <summary>      /// Generates model descriptions for given types. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs index 7c20658..27718ed 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs @@ -1,6 +1,6 @@  using System; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      /// <summary>      /// Use this attribute to change the name of the <see cref="ModelDescription"/> generated for a type. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs index c5558c6..0b6fe1b 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs @@ -3,7 +3,7 @@ using System.Globalization;  using System.Linq;  using System.Reflection; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      internal static class ModelNameHelper      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs index 31a726b..7dd708a 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs @@ -1,6 +1,6 @@  using System; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class ParameterAnnotation      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs index 53ea037..b021eb4 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs @@ -1,7 +1,7 @@  using System.Collections.Generic;  using System.Collections.ObjectModel; -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class ParameterDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs index d478205..a1fde3b 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Areas.HelpPage.ModelDescriptions +namespace HousingWebApi.Areas.HelpPage.ModelDescriptions  {      public class SimpleTypeModelDescription : ModelDescription      { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Models/HelpPageApiModel.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Models/HelpPageApiModel.cs index bb1e03a..25b512f 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Models/HelpPageApiModel.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Models/HelpPageApiModel.cs @@ -2,9 +2,9 @@ using System.Collections.Generic;  using System.Collections.ObjectModel;  using System.Net.Http.Headers;  using System.Web.Http.Description; -using HousingWebAPI.Areas.HelpPage.ModelDescriptions; +using HousingWebApi.Areas.HelpPage.ModelDescriptions; -namespace HousingWebAPI.Areas.HelpPage.Models +namespace HousingWebApi.Areas.HelpPage.Models  {      /// <summary>      /// The model that represents an API displayed on the help page. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs index 99754e9..8fc7aaa 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs @@ -13,7 +13,7 @@ using System.Web.Http.Description;  using System.Xml.Linq;  using Newtonsoft.Json; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// This class will generate the samples for the help page. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleKey.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleKey.cs index ac2afc0..769101a 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleKey.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleKey.cs @@ -3,7 +3,7 @@ using System.Collections.Generic;  using System.ComponentModel;  using System.Net.Http.Headers; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// This is used to identify the place where the sample should be applied. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ImageSample.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ImageSample.cs index 8b10fbe..25e5452 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ImageSample.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ImageSample.cs @@ -1,6 +1,6 @@  using System; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// This represents an image sample on the help page. There's a display template named ImageSample associated with this class. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs index 4b98400..46b70a7 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs @@ -1,6 +1,6 @@  using System; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs index 434d824..9a34023 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs @@ -6,7 +6,7 @@ using System.Globalization;  using System.Linq;  using System.Reflection; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// This class will create an object of a given type and populate it with sample data. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/SampleDirection.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/SampleDirection.cs index 15ab134..4538b28 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/SampleDirection.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/SampleDirection.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// Indicates whether the sample is used for request or response diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/TextSample.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/TextSample.cs index 0e9d959..26c0e99 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/TextSample.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/SampleGeneration/TextSample.cs @@ -1,6 +1,6 @@  using System; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// This represents a preformatted text sample on the help page. There's a display template named TextSample associated with this class. diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Api.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Api.cshtml index 3faf514..54de52c 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Api.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Api.cshtml @@ -1,5 +1,5 @@  @using System.Web.Http -@using HousingWebAPI.Areas.HelpPage.Models +@using HousingWebApi.Areas.HelpPage.Models  @model HelpPageApiModel  @{ diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml index 7a012da..8be198c 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml @@ -1,8 +1,8 @@  @using System.Web.Http  @using System.Web.Http.Controllers  @using System.Web.Http.Description -@using HousingWebAPI.Areas.HelpPage -@using HousingWebAPI.Areas.HelpPage.Models +@using HousingWebApi.Areas.HelpPage +@using HousingWebApi.Areas.HelpPage.Models  @model IGrouping<HttpControllerDescriptor, ApiDescription>  @{ diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml index 74b111d..9f4b62c 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model CollectionModelDescription  @if (Model.ElementDescription is ComplexTypeModelDescription)  { diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml index bb7e331..5963685 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml @@ -1,3 +1,3 @@ -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model ComplexTypeModelDescription  @Html.DisplayFor(m => m.Properties, "Parameters")
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml index 9e501fb..9fe64f8 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model DictionaryModelDescription  Dictionary of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]  and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml index 268f15b..69cb12d 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model EnumTypeModelDescription  <p>Possible enumeration values:</p> diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml index b3228ee..e107cae 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml @@ -1,7 +1,7 @@  @using System.Web.Http  @using System.Web.Http.Description -@using HousingWebAPI.Areas.HelpPage.Models -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.Models +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model HelpPageApiModel  @{ diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml index 050d97a..4b0144a 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage +@using HousingWebApi.Areas.HelpPage  @model ImageSample  <img src="@Model.Src" />
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml index e144ff6..9967e5f 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage +@using HousingWebApi.Areas.HelpPage  @model InvalidSample  @if (HttpContext.Current.IsDebuggingEnabled) diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml index 669e994..91e9cff 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model KeyValuePairModelDescription  Pair of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]  and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml index f183f22..13c8ccc 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model Type  @{      ModelDescription modelDescription = ViewBag.modelDescription; diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml index 6d633e9..045a4e4 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml @@ -2,7 +2,7 @@  @using System.Collections.ObjectModel  @using System.Web.Http.Description  @using System.Threading -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model IList<ParameterDescription>  @if (Model.Count > 0) diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml index edc2351..4433658 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml @@ -1,3 +1,3 @@ -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model SimpleTypeModelDescription  @Model.Documentation
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml index 8ff414b..f47154f 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml @@ -1,4 +1,4 @@ -@using HousingWebAPI.Areas.HelpPage +@using HousingWebApi.Areas.HelpPage  @model TextSample  <pre class="wrapped"> diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Index.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Index.cshtml index 0becc96..51eb9c0 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Index.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/Index.cshtml @@ -2,7 +2,7 @@  @using System.Web.Http.Controllers  @using System.Web.Http.Description  @using System.Collections.ObjectModel -@using HousingWebAPI.Areas.HelpPage.Models +@using HousingWebApi.Areas.HelpPage.Models  @model Collection<ApiDescription>  @{ diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/ResourceModel.cshtml b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/ResourceModel.cshtml index 702a2c3..db20b87 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/ResourceModel.cshtml +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/Views/Help/ResourceModel.cshtml @@ -1,5 +1,5 @@  @using System.Web.Http -@using HousingWebAPI.Areas.HelpPage.ModelDescriptions +@using HousingWebApi.Areas.HelpPage.ModelDescriptions  @model ModelDescription  <link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" /> diff --git a/ApartmentManager/HousingWebAPI/Areas/HelpPage/XmlDocumentationProvider.cs b/ApartmentManager/HousingWebAPI/Areas/HelpPage/XmlDocumentationProvider.cs index 0eeefb9..b7a347c 100644 --- a/ApartmentManager/HousingWebAPI/Areas/HelpPage/XmlDocumentationProvider.cs +++ b/ApartmentManager/HousingWebAPI/Areas/HelpPage/XmlDocumentationProvider.cs @@ -5,9 +5,9 @@ using System.Reflection;  using System.Web.Http.Controllers;  using System.Web.Http.Description;  using System.Xml.XPath; -using HousingWebAPI.Areas.HelpPage.ModelDescriptions; +using HousingWebApi.Areas.HelpPage.ModelDescriptions; -namespace HousingWebAPI.Areas.HelpPage +namespace HousingWebApi.Areas.HelpPage  {      /// <summary>      /// A custom <see cref="IDocumentationProvider"/> that reads the API documentation from an XML documentation file. diff --git a/ApartmentManager/HousingWebAPI/Controllers/ApartmentsController.cs b/ApartmentManager/HousingWebAPI/Controllers/ApartmentsController.cs index d567555..a3de905 100644 --- a/ApartmentManager/HousingWebAPI/Controllers/ApartmentsController.cs +++ b/ApartmentManager/HousingWebAPI/Controllers/ApartmentsController.cs @@ -8,48 +8,48 @@ using System.Net;  using System.Net.Http;  using System.Web.Http;  using System.Web.Http.Description; -using HousingWebAPI.Models; +using HousingWebApi; -namespace HousingWebAPI.Controllers +namespace HousingWebApi.Controllers  {      public class ApartmentsController : ApiController      { -        private ApartmentsDataContext db = new ApartmentsDataContext(); +        private DataModel db = new DataModel();          // GET: api/Apartments -        public IQueryable<Apartments> GetApartments() +        public IQueryable<Apartment> GetApartments()          {              return db.Apartments;          }          // GET: api/Apartments/5 -        [ResponseType(typeof(Apartments))] -        public IHttpActionResult GetApartments(int id) +        [ResponseType(typeof(Apartment))] +        public IHttpActionResult GetApartment(int id)          { -            Apartments apartments = db.Apartments.Find(id); -            if (apartments == null) +            Apartment apartment = db.Apartments.Find(id); +            if (apartment == null)              {                  return NotFound();              } -            return Ok(apartments); +            return Ok(apartment);          }          // PUT: api/Apartments/5          [ResponseType(typeof(void))] -        public IHttpActionResult PutApartments(int id, Apartments apartments) +        public IHttpActionResult PutApartment(int id, Apartment apartment)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            if (id != apartments.ApartmentNumber) +            if (id != apartment.ApartmentNumber)              {                  return BadRequest();              } -            db.Entry(apartments).State = EntityState.Modified; +            db.Entry(apartment).State = EntityState.Modified;              try              { @@ -57,7 +57,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateConcurrencyException)              { -                if (!ApartmentsExists(id)) +                if (!ApartmentExists(id))                  {                      return NotFound();                  } @@ -71,15 +71,15 @@ namespace HousingWebAPI.Controllers          }          // POST: api/Apartments -        [ResponseType(typeof(Apartments))] -        public IHttpActionResult PostApartments(Apartments apartments) +        [ResponseType(typeof(Apartment))] +        public IHttpActionResult PostApartment(Apartment apartment)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            db.Apartments.Add(apartments); +            db.Apartments.Add(apartment);              try              { @@ -87,7 +87,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateException)              { -                if (ApartmentsExists(apartments.ApartmentNumber)) +                if (ApartmentExists(apartment.ApartmentNumber))                  {                      return Conflict();                  } @@ -97,23 +97,23 @@ namespace HousingWebAPI.Controllers                  }              } -            return CreatedAtRoute("DefaultApi", new { id = apartments.ApartmentNumber }, apartments); +            return CreatedAtRoute("DefaultApi", new { id = apartment.ApartmentNumber }, apartment);          }          // DELETE: api/Apartments/5 -        [ResponseType(typeof(Apartments))] -        public IHttpActionResult DeleteApartments(int id) +        [ResponseType(typeof(Apartment))] +        public IHttpActionResult DeleteApartment(int id)          { -            Apartments apartments = db.Apartments.Find(id); -            if (apartments == null) +            Apartment apartment = db.Apartments.Find(id); +            if (apartment == null)              {                  return NotFound();              } -            db.Apartments.Remove(apartments); +            db.Apartments.Remove(apartment);              db.SaveChanges(); -            return Ok(apartments); +            return Ok(apartment);          }          protected override void Dispose(bool disposing) @@ -125,7 +125,7 @@ namespace HousingWebAPI.Controllers              base.Dispose(disposing);          } -        private bool ApartmentsExists(int id) +        private bool ApartmentExists(int id)          {              return db.Apartments.Count(e => e.ApartmentNumber == id) > 0;          } diff --git a/ApartmentManager/HousingWebAPI/Controllers/DefectsController.cs b/ApartmentManager/HousingWebAPI/Controllers/DefectsController.cs index 9aad195..aa6f519 100644 --- a/ApartmentManager/HousingWebAPI/Controllers/DefectsController.cs +++ b/ApartmentManager/HousingWebAPI/Controllers/DefectsController.cs @@ -8,48 +8,48 @@ using System.Net;  using System.Net.Http;  using System.Web.Http;  using System.Web.Http.Description; -using HousingWebAPI.Models; +using HousingWebApi; -namespace HousingWebAPI.Controllers +namespace HousingWebApi.Controllers  {      public class DefectsController : ApiController      { -        private ApartmentsDataContext db = new ApartmentsDataContext(); +        private DataModel db = new DataModel();          // GET: api/Defects -        public IQueryable<Defects> GetDefects() +        public IQueryable<Defect> GetDefects()          {              return db.Defects;          }          // GET: api/Defects/5 -        [ResponseType(typeof(Defects))] -        public IHttpActionResult GetDefects(int id) +        [ResponseType(typeof(Defect))] +        public IHttpActionResult GetDefect(int id)          { -            Defects defects = db.Defects.Find(id); -            if (defects == null) +            Defect defect = db.Defects.Find(id); +            if (defect == null)              {                  return NotFound();              } -            return Ok(defects); +            return Ok(defect);          }          // PUT: api/Defects/5          [ResponseType(typeof(void))] -        public IHttpActionResult PutDefects(int id, Defects defects) +        public IHttpActionResult PutDefect(int id, Defect defect)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            if (id != defects.DefectNumber) +            if (id != defect.DefectNumber)              {                  return BadRequest();              } -            db.Entry(defects).State = EntityState.Modified; +            db.Entry(defect).State = EntityState.Modified;              try              { @@ -57,7 +57,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateConcurrencyException)              { -                if (!DefectsExists(id)) +                if (!DefectExists(id))                  {                      return NotFound();                  } @@ -71,15 +71,15 @@ namespace HousingWebAPI.Controllers          }          // POST: api/Defects -        [ResponseType(typeof(Defects))] -        public IHttpActionResult PostDefects(Defects defects) +        [ResponseType(typeof(Defect))] +        public IHttpActionResult PostDefect(Defect defect)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            db.Defects.Add(defects); +            db.Defects.Add(defect);              try              { @@ -87,7 +87,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateException)              { -                if (DefectsExists(defects.DefectNumber)) +                if (DefectExists(defect.DefectNumber))                  {                      return Conflict();                  } @@ -97,23 +97,23 @@ namespace HousingWebAPI.Controllers                  }              } -            return CreatedAtRoute("DefaultApi", new { id = defects.DefectNumber }, defects); +            return CreatedAtRoute("DefaultApi", new { id = defect.DefectNumber }, defect);          }          // DELETE: api/Defects/5 -        [ResponseType(typeof(Defects))] -        public IHttpActionResult DeleteDefects(int id) +        [ResponseType(typeof(Defect))] +        public IHttpActionResult DeleteDefect(int id)          { -            Defects defects = db.Defects.Find(id); -            if (defects == null) +            Defect defect = db.Defects.Find(id); +            if (defect == null)              {                  return NotFound();              } -            db.Defects.Remove(defects); +            db.Defects.Remove(defect);              db.SaveChanges(); -            return Ok(defects); +            return Ok(defect);          }          protected override void Dispose(bool disposing) @@ -125,7 +125,7 @@ namespace HousingWebAPI.Controllers              base.Dispose(disposing);          } -        private bool DefectsExists(int id) +        private bool DefectExists(int id)          {              return db.Defects.Count(e => e.DefectNumber == id) > 0;          } diff --git a/ApartmentManager/HousingWebAPI/Controllers/HomeController.cs b/ApartmentManager/HousingWebAPI/Controllers/HomeController.cs index e48b8a5..fcd58bd 100644 --- a/ApartmentManager/HousingWebAPI/Controllers/HomeController.cs +++ b/ApartmentManager/HousingWebAPI/Controllers/HomeController.cs @@ -4,7 +4,7 @@ using System.Linq;  using System.Web;  using System.Web.Mvc; -namespace HousingWebAPI.Controllers +namespace HousingWebApi.Controllers  {      public class HomeController : Controller      { diff --git a/ApartmentManager/HousingWebAPI/Controllers/ResidentsController.cs b/ApartmentManager/HousingWebAPI/Controllers/ResidentsController.cs index 7ebf320..b744392 100644 --- a/ApartmentManager/HousingWebAPI/Controllers/ResidentsController.cs +++ b/ApartmentManager/HousingWebAPI/Controllers/ResidentsController.cs @@ -8,48 +8,48 @@ using System.Net;  using System.Net.Http;  using System.Web.Http;  using System.Web.Http.Description; -using HousingWebAPI.Models; +using HousingWebApi; -namespace HousingWebAPI.Controllers +namespace HousingWebApi.Controllers  {      public class ResidentsController : ApiController      { -        private ApartmentsDataContext db = new ApartmentsDataContext(); +        private DataModel db = new DataModel();          // GET: api/Residents -        public IQueryable<Residents> GetResidents() +        public IQueryable<Resident> GetResidents()          {              return db.Residents;          }          // GET: api/Residents/5 -        [ResponseType(typeof(Residents))] -        public IHttpActionResult GetResidents(int id) +        [ResponseType(typeof(Resident))] +        public IHttpActionResult GetResident(int id)          { -            Residents residents = db.Residents.Find(id); -            if (residents == null) +            Resident resident = db.Residents.Find(id); +            if (resident == null)              {                  return NotFound();              } -            return Ok(residents); +            return Ok(resident);          }          // PUT: api/Residents/5          [ResponseType(typeof(void))] -        public IHttpActionResult PutResidents(int id, Residents residents) +        public IHttpActionResult PutResident(int id, Resident resident)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            if (id != residents.ResidentNumber) +            if (id != resident.ResidentNr)              {                  return BadRequest();              } -            db.Entry(residents).State = EntityState.Modified; +            db.Entry(resident).State = EntityState.Modified;              try              { @@ -57,7 +57,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateConcurrencyException)              { -                if (!ResidentsExists(id)) +                if (!ResidentExists(id))                  {                      return NotFound();                  } @@ -71,15 +71,15 @@ namespace HousingWebAPI.Controllers          }          // POST: api/Residents -        [ResponseType(typeof(Residents))] -        public IHttpActionResult PostResidents(Residents residents) +        [ResponseType(typeof(Resident))] +        public IHttpActionResult PostResident(Resident resident)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            db.Residents.Add(residents); +            db.Residents.Add(resident);              try              { @@ -87,7 +87,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateException)              { -                if (ResidentsExists(residents.ResidentNumber)) +                if (ResidentExists(resident.ResidentNr))                  {                      return Conflict();                  } @@ -97,23 +97,23 @@ namespace HousingWebAPI.Controllers                  }              } -            return CreatedAtRoute("DefaultApi", new { id = residents.ResidentNumber }, residents); +            return CreatedAtRoute("DefaultApi", new { id = resident.ResidentNr }, resident);          }          // DELETE: api/Residents/5 -        [ResponseType(typeof(Residents))] -        public IHttpActionResult DeleteResidents(int id) +        [ResponseType(typeof(Resident))] +        public IHttpActionResult DeleteResident(int id)          { -            Residents residents = db.Residents.Find(id); -            if (residents == null) +            Resident resident = db.Residents.Find(id); +            if (resident == null)              {                  return NotFound();              } -            db.Residents.Remove(residents); +            db.Residents.Remove(resident);              db.SaveChanges(); -            return Ok(residents); +            return Ok(resident);          }          protected override void Dispose(bool disposing) @@ -125,9 +125,9 @@ namespace HousingWebAPI.Controllers              base.Dispose(disposing);          } -        private bool ResidentsExists(int id) +        private bool ResidentExists(int id)          { -            return db.Residents.Count(e => e.ResidentNumber == id) > 0; +            return db.Residents.Count(e => e.ResidentNr == id) > 0;          }      }  }
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/Controllers/UsersController.cs b/ApartmentManager/HousingWebAPI/Controllers/UsersController.cs index dbbc31c..af3ac1d 100644 --- a/ApartmentManager/HousingWebAPI/Controllers/UsersController.cs +++ b/ApartmentManager/HousingWebAPI/Controllers/UsersController.cs @@ -8,48 +8,62 @@ using System.Net;  using System.Net.Http;  using System.Web.Http;  using System.Web.Http.Description; -using HousingWebAPI.Models; +using HousingWebApi; -namespace HousingWebAPI.Controllers +namespace HousingWebApi.Controllers  {      public class UsersController : ApiController      { -        private ApartmentsDataContext db = new ApartmentsDataContext(); +        private DataModel db = new DataModel(); -        // GET: api/UsersVartotojas -        public IQueryable<Users> GetUsers() +        // GET: api/Users +        public IQueryable<User> GetUsers()          {              return db.Users;          } +        // GET: api/Users/by-username/username +        //[ResponseType(typeof(User))] +        //[Route("api/Users/by-username/{username:string}")] +        //public IHttpActionResult GetUserByUsername(string username) +        //{ +        //    User user = db.Users.Find(username); +        //    if (user == null) +        //    { +        //        return NotFound(); +        //    } + +        //    return Ok(user); +        //} +          // GET: api/Users/5 -        [ResponseType(typeof(Users))] -        public IHttpActionResult GetUsers(int id) +        [ResponseType(typeof(User))] +        public IHttpActionResult GetUser(int id)          { -            Users users = db.Users.Find(id); -            if (users == null) +            User user = db.Users.Find(id); +            if (user == null)              {                  return NotFound();              } -            return Ok(users); +            return Ok(user);          }          // PUT: api/Users/5          [ResponseType(typeof(void))] -        public IHttpActionResult PutUsers(int id, Users users) +        public IHttpActionResult PutUser(int id, User user)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            if (id != users.ResidentNumber) +            if (id != user.ApartmentNr)              {                  return BadRequest();              } -            db.Entry(users).State = EntityState.Modified; +            db.Entry(user).State = EntityState.Modified;              try              { @@ -57,7 +71,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateConcurrencyException)              { -                if (!UsersExists(id)) +                if (!UserExists(id))                  {                      return NotFound();                  } @@ -71,15 +85,15 @@ namespace HousingWebAPI.Controllers          }          // POST: api/Users -        [ResponseType(typeof(Users))] -        public IHttpActionResult PostUsers(Users users) +        [ResponseType(typeof(User))] +        public IHttpActionResult PostUser(User user)          {              if (!ModelState.IsValid)              {                  return BadRequest(ModelState);              } -            db.Users.Add(users); +            db.Users.Add(user);              try              { @@ -87,7 +101,7 @@ namespace HousingWebAPI.Controllers              }              catch (DbUpdateException)              { -                if (UsersExists(users.ResidentNumber)) +                if (UserExists(user.ApartmentNr))                  {                      return Conflict();                  } @@ -97,23 +111,23 @@ namespace HousingWebAPI.Controllers                  }              } -            return CreatedAtRoute("DefaultApi", new { id = users.ResidentNumber }, users); +            return CreatedAtRoute("DefaultApi", new { id = user.ApartmentNr }, user);          }          // DELETE: api/Users/5 -        [ResponseType(typeof(Users))] -        public IHttpActionResult DeleteUsers(int id) +        [ResponseType(typeof(User))] +        public IHttpActionResult DeleteUser(int id)          { -            Users users = db.Users.Find(id); -            if (users == null) +            User user = db.Users.Find(id); +            if (user == null)              {                  return NotFound();              } -            db.Users.Remove(users); +            db.Users.Remove(user);              db.SaveChanges(); -            return Ok(users); +            return Ok(user);          }          protected override void Dispose(bool disposing) @@ -125,9 +139,9 @@ namespace HousingWebAPI.Controllers              base.Dispose(disposing);          } -        private bool UsersExists(int id) +        private bool UserExists(int id)          { -            return db.Users.Count(e => e.ResidentNumber == id) > 0; +            return db.Users.Count(e => e.ApartmentNr == id) > 0;          }      }  }
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/Controllers/ValuesController.cs b/ApartmentManager/HousingWebAPI/Controllers/ValuesController.cs deleted file mode 100644 index 42e196f..0000000 --- a/ApartmentManager/HousingWebAPI/Controllers/ValuesController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Web.Http; - -namespace HousingWebAPI.Controllers -{ -    public class ValuesController : ApiController -    { -        // GET api/values -        public IEnumerable<string> Get() -        { -            return new string[] { "value1", "value2" }; -        } - -        // GET api/values/5 -        public string Get(int id) -        { -            return "value"; -        } - -        // POST api/values -        public void Post([FromBody]string value) -        { -        } - -        // PUT api/values/5 -        public void Put(int id, [FromBody]string value) -        { -        } - -        // DELETE api/values/5 -        public void Delete(int id) -        { -        } -    } -} diff --git a/ApartmentManager/HousingWebAPI/Global.asax b/ApartmentManager/HousingWebAPI/Global.asax index 9cbf668..7fe6e48 100644 --- a/ApartmentManager/HousingWebAPI/Global.asax +++ b/ApartmentManager/HousingWebAPI/Global.asax @@ -1 +1 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="HousingWebAPI.WebApiApplication" Language="C#" %> +<%@ Application Codebehind="Global.asax.cs" Inherits="HousingWebApi.WebApiApplication" Language="C#" %> diff --git a/ApartmentManager/HousingWebAPI/Global.asax.cs b/ApartmentManager/HousingWebAPI/Global.asax.cs index 597224d..a431bc7 100644 --- a/ApartmentManager/HousingWebAPI/Global.asax.cs +++ b/ApartmentManager/HousingWebAPI/Global.asax.cs @@ -7,7 +7,7 @@ using System.Web.Mvc;  using System.Web.Optimization;  using System.Web.Routing; -namespace HousingWebAPI +namespace HousingWebApi  {      public class WebApiApplication : System.Web.HttpApplication      { diff --git a/ApartmentManager/HousingWebAPI/HousingWebAPI.csproj b/ApartmentManager/HousingWebAPI/HousingWebAPI.csproj index 29ab1ec..462519c 100644 --- a/ApartmentManager/HousingWebAPI/HousingWebAPI.csproj +++ b/ApartmentManager/HousingWebAPI/HousingWebAPI.csproj @@ -1,7 +1,7 @@  <?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> -  <Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" /> -  <Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" /> +<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +  <Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" /> +  <Import Project="..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />    <PropertyGroup>      <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -9,12 +9,12 @@      <ProductVersion>      </ProductVersion>      <SchemaVersion>2.0</SchemaVersion> -    <ProjectGuid>{E57E89D2-7DEA-433B-B7D3-CF27D6FDDE47}</ProjectGuid> +    <ProjectGuid>{D777744A-9676-4193-BD59-6F30C724C87A}</ProjectGuid>      <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>      <OutputType>Library</OutputType>      <AppDesignerFolder>Properties</AppDesignerFolder> -    <RootNamespace>HousingWebAPI</RootNamespace> -    <AssemblyName>HousingWebAPI</AssemblyName> +    <RootNamespace>HousingWebApi</RootNamespace> +    <AssemblyName>HousingWebApi</AssemblyName>      <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>      <MvcBuildViews>false</MvcBuildViews>      <UseIISExpress>true</UseIISExpress> @@ -36,6 +36,7 @@      <WarningLevel>4</WarningLevel>    </PropertyGroup>    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> +    <DebugSymbols>true</DebugSymbols>      <DebugType>pdbonly</DebugType>      <Optimize>true</Optimize>      <OutputPath>bin\</OutputPath> @@ -46,43 +47,12 @@    <ItemGroup>      <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">        <HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath> -      <Private>True</Private>      </Reference>      <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">        <HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath> -      <Private>True</Private> -    </Reference> -    <Reference Include="Microsoft.AI.Agent.Intercept, Version=2.0.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath> -      <Private>True</Private> -    </Reference> -    <Reference Include="Microsoft.AI.DependencyCollector, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\lib\net45\Microsoft.AI.DependencyCollector.dll</HintPath> -      <Private>True</Private> -    </Reference> -    <Reference Include="Microsoft.AI.PerfCounterCollector, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\lib\net45\Microsoft.AI.PerfCounterCollector.dll</HintPath> -      <Private>True</Private> -    </Reference> -    <Reference Include="Microsoft.AI.ServerTelemetryChannel, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.2.0\lib\net45\Microsoft.AI.ServerTelemetryChannel.dll</HintPath> -      <Private>True</Private>      </Reference> -    <Reference Include="Microsoft.AI.Web, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.ApplicationInsights.Web.2.2.0\lib\net45\Microsoft.AI.Web.dll</HintPath> -      <Private>True</Private> -    </Reference> -    <Reference Include="Microsoft.AI.WindowsServer, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.ApplicationInsights.WindowsServer.2.2.0\lib\net45\Microsoft.AI.WindowsServer.dll</HintPath> -      <Private>True</Private> -    </Reference> -    <Reference Include="Microsoft.ApplicationInsights, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll</HintPath> -      <Private>True</Private> -    </Reference> -    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> -      <HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath> -      <Private>True</Private> +    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> +      <HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>      </Reference>      <Reference Include="Microsoft.CSharp" />      <Reference Include="System" /> @@ -158,9 +128,35 @@      </Reference>    </ItemGroup>    <ItemGroup> -    <Folder Include="App_Data\" /> +    <Reference Include="Microsoft.ApplicationInsights"> +      <HintPath>..\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll</HintPath> +    </Reference> +    <Reference Include="Microsoft.AI.Agent.Intercept"> +      <HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath> +    </Reference> +    <Reference Include="Microsoft.AI.DependencyCollector"> +      <HintPath>..\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\lib\net45\Microsoft.AI.DependencyCollector.dll</HintPath> +    </Reference> +    <Reference Include="Microsoft.AI.PerfCounterCollector"> +      <HintPath>..\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\lib\net45\Microsoft.AI.PerfCounterCollector.dll</HintPath> +    </Reference> +    <Reference Include="Microsoft.AI.ServerTelemetryChannel"> +      <HintPath>..\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.2.0\lib\net45\Microsoft.AI.ServerTelemetryChannel.dll</HintPath> +    </Reference> +    <Reference Include="Microsoft.AI.WindowsServer"> +      <HintPath>..\packages\Microsoft.ApplicationInsights.WindowsServer.2.2.0\lib\net45\Microsoft.AI.WindowsServer.dll</HintPath> +    </Reference> +    <Reference Include="Microsoft.AI.Web"> +      <HintPath>..\packages\Microsoft.ApplicationInsights.Web.2.2.0\lib\net45\Microsoft.AI.Web.dll</HintPath> +    </Reference>    </ItemGroup>    <ItemGroup> +    <Compile Include="Controllers\ApartmentsController.cs" /> +    <Compile Include="Controllers\DefectsController.cs" /> +    <Compile Include="Controllers\PastContractOwnersController.cs" /> +    <Compile Include="Controllers\ResidentsController.cs" /> +    <Compile Include="Controllers\UsersController.cs" /> +    <Compile Include="Models\Apartment.cs" />      <Compile Include="App_Start\BundleConfig.cs" />      <Compile Include="App_Start\FilterConfig.cs" />      <Compile Include="App_Start\RouteConfig.cs" /> @@ -193,22 +189,16 @@      <Compile Include="Areas\HelpPage\SampleGeneration\SampleDirection.cs" />      <Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />      <Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" /> -    <Compile Include="Controllers\ApartmentsController.cs" /> -    <Compile Include="Controllers\DefectsController.cs" />      <Compile Include="Controllers\HomeController.cs" /> -    <Compile Include="Controllers\ResidentsController.cs" /> -    <Compile Include="Controllers\UsersController.cs" /> -    <Compile Include="Controllers\ValuesController.cs" /> +    <Compile Include="DataModel.cs" /> +    <Compile Include="Models\Defect.cs" />      <Compile Include="Global.asax.cs">        <DependentUpon>Global.asax</DependentUpon>      </Compile> -    <Compile Include="Models\Apartments.cs" /> -    <Compile Include="Models\ApartmentsDataContext.cs" /> -    <Compile Include="Models\Defects.cs" /> -    <Compile Include="Models\PastContractOwners.cs" /> -    <Compile Include="Models\Residents.cs" /> -    <Compile Include="Models\Users.cs" /> +    <Compile Include="Models\PastContractOwner.cs" />      <Compile Include="Properties\AssemblyInfo.cs" /> +    <Compile Include="Models\Resident.cs" /> +    <Compile Include="Models\User.cs" />    </ItemGroup>    <ItemGroup>      <Content Include="Areas\HelpPage\HelpPage.css" /> @@ -256,20 +246,28 @@      </Content>      <Content Include="Areas\HelpPage\Views\_ViewStart.cshtml" />      <Content Include="Content\Site.css" /> -    <Content Include="Scripts\_references.js" />      <Content Include="Views\Web.config" />      <Content Include="Views\_ViewStart.cshtml" />      <Content Include="Views\Home\Index.cshtml" />      <Content Include="Views\Shared\Error.cshtml" />      <Content Include="Views\Shared\_Layout.cshtml" />    </ItemGroup> -  <ItemGroup /> +  <ItemGroup> +    <Folder Include="App_Data\" /> +  </ItemGroup>    <ItemGroup>      <Content Include="fonts\glyphicons-halflings-regular.woff" /> +  </ItemGroup> +  <ItemGroup>      <Content Include="fonts\glyphicons-halflings-regular.ttf" /> +  </ItemGroup> +  <ItemGroup>      <Content Include="fonts\glyphicons-halflings-regular.eot" /> +  </ItemGroup> +  <ItemGroup>      <Content Include="packages.config" /> -    <None Include="Project_Readme.html" /> +  </ItemGroup> +  <ItemGroup>      <Content Include="Scripts\jquery-1.10.2.min.map" />    </ItemGroup>    <PropertyGroup> @@ -288,7 +286,7 @@          <WebProjectProperties>            <UseIIS>True</UseIIS>            <AutoAssignPort>True</AutoAssignPort> -          <DevelopmentServerPort>60916</DevelopmentServerPort> +          <DevelopmentServerPort>58478</DevelopmentServerPort>            <DevelopmentServerVPath>/</DevelopmentServerVPath>            <IISUrl>http://localhost:60916/</IISUrl>            <NTLMAuthentication>False</NTLMAuthentication> @@ -304,8 +302,8 @@      <PropertyGroup>        <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>      </PropertyGroup> -    <Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" /> -    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" /> +    <Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props'))" /> +    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />    </Target>    <!-- To modify your build process, add your task inside one of the targets below and uncomment it.         Other similar extension points exist, see Microsoft.Common.targets. diff --git a/ApartmentManager/HousingWebAPI/Models/ApartmentsDataContext.cs b/ApartmentManager/HousingWebAPI/Models/ApartmentsDataContext.cs deleted file mode 100644 index 1576b92..0000000 --- a/ApartmentManager/HousingWebAPI/Models/ApartmentsDataContext.cs +++ /dev/null @@ -1,114 +0,0 @@ -namespace HousingWebAPI.Models -{ -    using System; -    using System.Data.Entity; -    using System.ComponentModel.DataAnnotations.Schema; -    using System.Linq; - -    public partial class ApartmentsDataContext : DbContext -    { -        public ApartmentsDataContext() -            : base("name=ApartmentsDataContext") -        { -        } - -        public virtual DbSet<Apartments> Apartments { get; set; } -        public virtual DbSet<Defects> Defects { get; set; } -        public virtual DbSet<PastContractOwners> PastContractOwners { get; set; } -        public virtual DbSet<Residents> Residents { get; set; } -        public virtual DbSet<Users> Users { get; set; } - -        protected override void OnModelCreating(DbModelBuilder modelBuilder) -        { -            modelBuilder.Entity<Apartments>() -                .Property(e => e.Size) -                .HasPrecision(18, 0); - -            modelBuilder.Entity<Apartments>() -                .Property(e => e.MonthlyCharge) -                .IsFixedLength(); - -            modelBuilder.Entity<Apartments>() -                .HasMany(e => e.Defects) -                .WithRequired(e => e.Apartments) -                .HasForeignKey(e => e.ApartmentNr) -                .WillCascadeOnDelete(false); - -            modelBuilder.Entity<Apartments>() -                .HasMany(e => e.Residents) -                .WithRequired(e => e.Apartments) -                .HasForeignKey(e => e.ApartmentNr) -                .WillCascadeOnDelete(false); - -            modelBuilder.Entity<Apartments>() -                .HasMany(e => e.Users) -                .WithRequired(e => e.Apartments) -                .HasForeignKey(e => e.ApartmentNr) -                .WillCascadeOnDelete(false); - -            modelBuilder.Entity<Defects>() -                .Property(e => e.Name) -                .IsFixedLength(); - -            modelBuilder.Entity<Defects>() -                .Property(e => e.Description) -                .IsUnicode(false); - -            modelBuilder.Entity<Defects>() -                .Property(e => e.Comment) -                .IsUnicode(false); - -            modelBuilder.Entity<Defects>() -                .Property(e => e.Status) -                .IsFixedLength(); - -            modelBuilder.Entity<PastContractOwners>() -                .Property(e => e.ApartmentNr) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.Name) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.LastName) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.Email) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.SecondName) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.SecondLastName) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.SecondEmail) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.Username) -                .IsFixedLength(); - -            modelBuilder.Entity<Residents>() -                .Property(e => e.Password) -                .IsFixedLength(); - -            modelBuilder.Entity<Users>() -                .Property(e => e.Name) -                .IsFixedLength(); - -            modelBuilder.Entity<Users>() -                .Property(e => e.LastName) -                .IsFixedLength(); - -            modelBuilder.Entity<Users>() -                .Property(e => e.Email) -                .IsFixedLength(); -        } -    } -} diff --git a/ApartmentManager/HousingWebAPI/Project_Readme.html b/ApartmentManager/HousingWebAPI/Project_Readme.html deleted file mode 100644 index 5cc26aa..0000000 --- a/ApartmentManager/HousingWebAPI/Project_Readme.html +++ /dev/null @@ -1,149 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> -    <meta charset="utf-8" /> -    <title>Your ASP.NET application</title> -    <style> -        body { -            background: #fff; -            color: #505050; -            font: 14px 'Segoe UI', tahoma, arial, helvetica, sans-serif; -            margin: 20px; -            padding: 0; -        } - -        #header { -            background: #efefef; -            padding: 0; -        } - -        h1 { -            font-size: 48px; -            font-weight: normal; -            margin: 0; -            padding: 0 30px; -            line-height: 150px; -        } - -        p { -            font-size: 20px; -            color: #fff; -            background: #969696; -            padding: 0 30px; -            line-height: 50px; -        } - -        #main { -            padding: 5px 30px; -        } - -        .section { -            width: 21.7%; -            float: left; -            margin: 0 0 0 4%; -        } - -            .section h2 { -                font-size: 13px; -                text-transform: uppercase; -                margin: 0; -                border-bottom: 1px solid silver; -                padding-bottom: 12px; -                margin-bottom: 8px; -            } - -            .section.first { -                margin-left: 0; -            } - -                .section.first h2 { -                    font-size: 24px; -                    text-transform: none; -                    margin-bottom: 25px; -                    border: none; -                } - -                .section.first li { -                    border-top: 1px solid silver; -                    padding: 8px 0; -                } - -            .section.last { -                margin-right: 0; -            } - -        ul { -            list-style: none; -            padding: 0; -            margin: 0; -            line-height: 20px; -        } - -        li { -            padding: 4px 0; -        } - -        a { -            color: #267cb2; -            text-decoration: none; -        } - -            a:hover { -                text-decoration: underline; -            } -    </style> -</head> -<body> - -    <div id="header"> -        <h1>Your ASP.NET application</h1> -        <p>Congratulations! You've created a project</p> -    </div> - -    <div id="main"> -        <div class="section first"> -            <h2>This application consists of:</h2> -            <ul> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615543">Help Page</a> for documenting your Web APIs</li> -                <li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=615519">Bootstrap</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=320957">Authentication</a>, if selected, shows how to register and sign in</li> -                <li>ASP.NET features managed using <a href="http://go.microsoft.com/fwlink/?LinkID=320958">NuGet</a></li> -            </ul> -        </div> - -        <div class="section"> -            <h2>Customize app</h2> -            <ul> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=320959">Get started with HTTP services using ASP.NET Web API</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=320960">Change the site's theme</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=320961">Add more libraries using NuGet</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=320962">Configure authentication</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=320963">Scaffold an ASP.NET Web API from a model</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615545">Secure your web API</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615544">Access your web API on different devices</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615546">Enable tracing for testing and debugging</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615530">Add real-time web with ASP.NET SignalR</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615531">Add components using Scaffolding</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615533">Share your project</a></li> -            </ul> -        </div> - -        <div class="section"> -            <h2>Deploy</h2> -            <ul> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615534">Ensure your app is ready for production</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615535">Microsoft Azure</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615536">Hosting providers</a></li> -            </ul> -        </div> - -        <div class="section last"> -            <h2>Get help</h2> -            <ul> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615537">Get help</a></li> -                <li><a href="http://go.microsoft.com/fwlink/?LinkID=615538">Get more templates</a></li> -            </ul> -        </div> -    </div> -</body> -</html> diff --git a/ApartmentManager/HousingWebAPI/Properties/AssemblyInfo.cs b/ApartmentManager/HousingWebAPI/Properties/AssemblyInfo.cs index 1e0a5a9..6537723 100644 --- a/ApartmentManager/HousingWebAPI/Properties/AssemblyInfo.cs +++ b/ApartmentManager/HousingWebAPI/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ using System.Runtime.InteropServices;  // General Information about an assembly is controlled through the following  // set of attributes. Change these attribute values to modify the information  // associated with an assembly. -[assembly: AssemblyTitle("HousingWebAPI")] +[assembly: AssemblyTitle("HousingWebApi")]  [assembly: AssemblyDescription("")]  [assembly: AssemblyConfiguration("")]  [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HousingWebAPI")] +[assembly: AssemblyProduct("HousingWebApi")]  [assembly: AssemblyCopyright("Copyright ©  2017")]  [assembly: AssemblyTrademark("")]  [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ using System.Runtime.InteropServices;  [assembly: ComVisible(false)]  // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5094c7e2-5ace-436f-827f-4c7e99cd7d7a")] +[assembly: Guid("6e0d5aea-5a27-48f0-9d74-a8e0f91acc3b")]  // Version information for an assembly consists of the following four values:  // diff --git a/ApartmentManager/HousingWebAPI/Scripts/_references.js b/ApartmentManager/HousingWebAPI/Scripts/_references.js Binary files differdeleted file mode 100644 index cbe7a47..0000000 --- a/ApartmentManager/HousingWebAPI/Scripts/_references.js +++ /dev/null diff --git a/ApartmentManager/HousingWebAPI/Views/Home/Index.cshtml b/ApartmentManager/HousingWebAPI/Views/Home/Index.cshtml index acaf98f..9c34513 100644 --- a/ApartmentManager/HousingWebAPI/Views/Home/Index.cshtml +++ b/ApartmentManager/HousingWebAPI/Views/Home/Index.cshtml @@ -1,7 +1,7 @@  <div class="jumbotron">      <h1>ASP.NET</h1>      <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p> -    <p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more »</a></p> +    <p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more »</a></p>  </div>  <div class="row">      <div class="col-md-4"> @@ -9,16 +9,16 @@          <p>ASP.NET Web API is a framework that makes it easy to build HTTP services that reach          a broad range of clients, including browsers and mobile devices. ASP.NET Web API          is an ideal platform for building RESTful applications on the .NET Framework.</p> -        <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301870">Learn more »</a></p> +        <p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301870">Learn more »</a></p>      </div>      <div class="col-md-4">          <h2>Get more libraries</h2>          <p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p> -        <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301871">Learn more »</a></p> +        <p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301871">Learn more »</a></p>      </div>      <div class="col-md-4">          <h2>Web Hosting</h2>          <p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p> -        <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301872">Learn more »</a></p> +        <p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301872">Learn more »</a></p>      </div>  </div> diff --git a/ApartmentManager/HousingWebAPI/Views/Web.config b/ApartmentManager/HousingWebAPI/Views/Web.config index e43385d..2ab99b1 100644 --- a/ApartmentManager/HousingWebAPI/Views/Web.config +++ b/ApartmentManager/HousingWebAPI/Views/Web.config @@ -17,7 +17,7 @@          <add namespace="System.Web.Mvc.Html" />          <add namespace="System.Web.Optimization"/>          <add namespace="System.Web.Routing" /> -        <add namespace="HousingWebAPI" /> +        <add namespace="HousingWebApi" />        </namespaces>      </pages>    </system.web.webPages.razor> diff --git a/ApartmentManager/HousingWebAPI/Web.Debug.config b/ApartmentManager/HousingWebAPI/Web.Debug.config index 680849f..d7712aa 100644 --- a/ApartmentManager/HousingWebAPI/Web.Debug.config +++ b/ApartmentManager/HousingWebAPI/Web.Debug.config @@ -1,6 +1,6 @@  <?xml version="1.0"?> -<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=301874 --> +<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->  <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">    <!-- diff --git a/ApartmentManager/HousingWebAPI/Web.Release.config b/ApartmentManager/HousingWebAPI/Web.Release.config index 943c9c0..28a4d5f 100644 --- a/ApartmentManager/HousingWebAPI/Web.Release.config +++ b/ApartmentManager/HousingWebAPI/Web.Release.config @@ -1,6 +1,6 @@  <?xml version="1.0"?> -<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=301874 --> +<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->  <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">    <!-- diff --git a/ApartmentManager/HousingWebAPI/Web.config b/ApartmentManager/HousingWebAPI/Web.config index 7fe2076..309aba0 100644 --- a/ApartmentManager/HousingWebAPI/Web.config +++ b/ApartmentManager/HousingWebAPI/Web.config @@ -1,7 +1,7 @@  <?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 +  https://go.microsoft.com/fwlink/?LinkId=301879    -->  <configuration>    <configSections> @@ -64,8 +64,8 @@    </runtime>    <system.codedom>      <compilers> -      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /> -      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" /> +      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /> +      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />      </compilers>    </system.codedom>    <entityFramework> @@ -79,8 +79,6 @@      </providers>    </entityFramework>    <connectionStrings> -    <add name="Apartments" connectionString="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename="D:\C sharp\Databases\HousingDatabase.mdf";integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> -    <add name="Users" connectionString="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename="D:\C sharp\Databases\HousingDatabase.mdf";integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> -    <add name="ApartmentsDataContext" connectionString="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename="D:\C sharp\Databases\HousingDatabase.mdf";integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> -  </connectionStrings> +     +  <add name="DataModel" connectionString="data source=housingdb.database.windows.net;initial catalog=housingdb;persist security info=True;user id=deltaadmin;password=Delta123!;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /></connectionStrings>  </configuration>
\ No newline at end of file diff --git a/ApartmentManager/HousingWebAPI/packages.config b/ApartmentManager/HousingWebAPI/packages.config index 12642ae..556b5f7 100644 --- a/ApartmentManager/HousingWebAPI/packages.config +++ b/ApartmentManager/HousingWebAPI/packages.config @@ -20,8 +20,8 @@    <package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.3" targetFramework="net452" />    <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" />    <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" /> -  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" /> -  <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" /> +  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.3" targetFramework="net452" /> +  <package id="Microsoft.Net.Compilers" version="1.3.2" targetFramework="net452" developmentDependency="true" />    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />    <package id="Modernizr" version="2.6.2" targetFramework="net452" />    <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" /> diff --git a/ApartmentManager/HousingWebApi/Controllers/PastContractOwnersController.cs b/ApartmentManager/HousingWebApi/Controllers/PastContractOwnersController.cs new file mode 100644 index 0000000..d1f3e00 --- /dev/null +++ b/ApartmentManager/HousingWebApi/Controllers/PastContractOwnersController.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using System.Web.Http.Description; +using HousingWebApi; + +namespace HousingWebApi.Controllers +{ +    public class PastContractOwnersController : ApiController +    { +        private DataModel db = new DataModel(); + +        // GET: api/PastContractOwners +        public IQueryable<PastContractOwner> GetPastContractOwners() +        { +            return db.PastContractOwners; +        } + +        // GET: api/PastContractOwners/5 +        [ResponseType(typeof(PastContractOwner))] +        public IHttpActionResult GetPastContractOwner(int id) +        { +            PastContractOwner pastContractOwner = db.PastContractOwners.Find(id); +            if (pastContractOwner == null) +            { +                return NotFound(); +            } + +            return Ok(pastContractOwner); +        } + +        // PUT: api/PastContractOwners/5 +        [ResponseType(typeof(void))] +        public IHttpActionResult PutPastContractOwner(int id, PastContractOwner pastContractOwner) +        { +            if (!ModelState.IsValid) +            { +                return BadRequest(ModelState); +            } + +            if (id != pastContractOwner.Id) +            { +                return BadRequest(); +            } + +            db.Entry(pastContractOwner).State = EntityState.Modified; + +            try +            { +                db.SaveChanges(); +            } +            catch (DbUpdateConcurrencyException) +            { +                if (!PastContractOwnerExists(id)) +                { +                    return NotFound(); +                } +                else +                { +                    throw; +                } +            } + +            return StatusCode(HttpStatusCode.NoContent); +        } + +        // POST: api/PastContractOwners +        [ResponseType(typeof(PastContractOwner))] +        public IHttpActionResult PostPastContractOwner(PastContractOwner pastContractOwner) +        { +            if (!ModelState.IsValid) +            { +                return BadRequest(ModelState); +            } + +            db.PastContractOwners.Add(pastContractOwner); + +            try +            { +                db.SaveChanges(); +            } +            catch (DbUpdateException) +            { +                if (PastContractOwnerExists(pastContractOwner.Id)) +                { +                    return Conflict(); +                } +                else +                { +                    throw; +                } +            } + +            return CreatedAtRoute("DefaultApi", new { id = pastContractOwner.Id }, pastContractOwner); +        } + +        // DELETE: api/PastContractOwners/5 +        [ResponseType(typeof(PastContractOwner))] +        public IHttpActionResult DeletePastContractOwner(int id) +        { +            PastContractOwner pastContractOwner = db.PastContractOwners.Find(id); +            if (pastContractOwner == null) +            { +                return NotFound(); +            } + +            db.PastContractOwners.Remove(pastContractOwner); +            db.SaveChanges(); + +            return Ok(pastContractOwner); +        } + +        protected override void Dispose(bool disposing) +        { +            if (disposing) +            { +                db.Dispose(); +            } +            base.Dispose(disposing); +        } + +        private bool PastContractOwnerExists(int id) +        { +            return db.PastContractOwners.Count(e => e.Id == id) > 0; +        } +    } +}
\ No newline at end of file diff --git a/ApartmentManager/HousingWebApi/DataModel.cs b/ApartmentManager/HousingWebApi/DataModel.cs new file mode 100644 index 0000000..b4e7556 --- /dev/null +++ b/ApartmentManager/HousingWebApi/DataModel.cs @@ -0,0 +1,121 @@ +namespace HousingWebApi +{ +    using System; +    using System.Data.Entity; +    using System.ComponentModel.DataAnnotations.Schema; +    using System.Linq; + +    public partial class DataModel : DbContext +    { +        public DataModel() +            : base("name=DataModel") +        { +            base.Configuration.ProxyCreationEnabled = false; +        } + +        public virtual DbSet<Apartment> Apartments { get; set; } +        public virtual DbSet<Defect> Defects { get; set; } +        public virtual DbSet<PastContractOwner> PastContractOwners { get; set; } +        public virtual DbSet<Resident> Residents { get; set; } +        public virtual DbSet<User> Users { get; set; } + +        protected override void OnModelCreating(DbModelBuilder modelBuilder) +        { +            modelBuilder.Entity<Apartment>() +                .Property(e => e.Size) +                .HasPrecision(18, 0); + +            modelBuilder.Entity<Apartment>() +                .Property(e => e.MonthlyCharge) +                .IsFixedLength(); + +            modelBuilder.Entity<Apartment>() +                .Property(e => e.Address) +                .IsFixedLength(); + +            modelBuilder.Entity<Apartment>() +                .HasMany(e => e.Defects) +                .WithRequired(e => e.Apartment) +                .HasForeignKey(e => e.ApartmentNr) +                .WillCascadeOnDelete(false); + +            modelBuilder.Entity<Apartment>() +                .HasMany(e => e.Residents) +                .WithRequired(e => e.Apartment) +                .HasForeignKey(e => e.ApartmentNr) +                .WillCascadeOnDelete(false); + +            modelBuilder.Entity<Apartment>() +                .HasOptional(e => e.User) +                .WithRequired(e => e.Apartment); + +            modelBuilder.Entity<Defect>() +                .Property(e => e.Name) +                .IsFixedLength(); + +            modelBuilder.Entity<Defect>() +                .Property(e => e.Description) +                .IsUnicode(false); + +            modelBuilder.Entity<Defect>() +                .Property(e => e.Comment) +                .IsUnicode(false); + +            modelBuilder.Entity<Defect>() +                .Property(e => e.Status) +                .IsFixedLength(); + +            modelBuilder.Entity<PastContractOwner>() +                .Property(e => e.ApartmentNr) +                .IsFixedLength(); + +            modelBuilder.Entity<Resident>() +                .Property(e => e.FirstName) +                .IsFixedLength(); + +            modelBuilder.Entity<Resident>() +                .Property(e => e.LastName) +                .IsFixedLength(); + +            modelBuilder.Entity<Resident>() +                .Property(e => e.Email) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.Username) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.Password) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.FirstName) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.LastName) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.Phone) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.Email) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.SecondName) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.SecondLastName) +                .IsFixedLength(); + +            modelBuilder.Entity<User>() +                .Property(e => e.SecondEmail) +                .IsFixedLength(); +        } +    } +} diff --git a/ApartmentManager/HousingWebAPI/Models/Apartments.cs b/ApartmentManager/HousingWebApi/Models/Apartment.cs index f4357e9..16d884d 100644 --- a/ApartmentManager/HousingWebAPI/Models/Apartments.cs +++ b/ApartmentManager/HousingWebApi/Models/Apartment.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Models +namespace HousingWebApi  {      using System;      using System.Collections.Generic; @@ -6,14 +6,13 @@ namespace HousingWebAPI.Models      using System.ComponentModel.DataAnnotations.Schema;      using System.Data.Entity.Spatial; -    public partial class Apartments +    public partial class Apartment      {          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] -        public Apartments() +        public Apartment()          { -            Defects = new HashSet<Defects>(); -            Residents = new HashSet<Residents>(); -            Users = new HashSet<Users>(); +            Defects = new HashSet<Defect>(); +            Residents = new HashSet<Resident>();          }          [Key] @@ -27,13 +26,17 @@ namespace HousingWebAPI.Models          [StringLength(10)]          public string MonthlyCharge { get; set; } -        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] -        public virtual ICollection<Defects> Defects { get; set; } +        public int? Floor { get; set; } + +        [StringLength(50)] +        public string Address { get; set; }          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] -        public virtual ICollection<Residents> Residents { get; set; } +        public virtual ICollection<Defect> Defects { get; set; }          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] -        public virtual ICollection<Users> Users { get; set; } +        public virtual ICollection<Resident> Residents { get; set; } + +        public virtual User User { get; set; }      }  } diff --git a/ApartmentManager/HousingWebAPI/Models/Defects.cs b/ApartmentManager/HousingWebApi/Models/Defect.cs index 0cfb8e8..4336393 100644 --- a/ApartmentManager/HousingWebAPI/Models/Defects.cs +++ b/ApartmentManager/HousingWebApi/Models/Defect.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Models +namespace HousingWebApi  {      using System;      using System.Collections.Generic; @@ -6,7 +6,7 @@ namespace HousingWebAPI.Models      using System.ComponentModel.DataAnnotations.Schema;      using System.Data.Entity.Spatial; -    public partial class Defects +    public partial class Defect      {          [Key]          [DatabaseGenerated(DatabaseGeneratedOption.None)] @@ -22,6 +22,7 @@ namespace HousingWebAPI.Models          public DateTime DateUploaded { get; set; }          [Column(TypeName = "image")] +        [Required]          public byte[] Picture { get; set; }          [Column(TypeName = "image")] @@ -40,6 +41,6 @@ namespace HousingWebAPI.Models          [StringLength(10)]          public string Status { get; set; } -        public virtual Apartments Apartments { get; set; } +        public virtual Apartment Apartment { get; set; }      }  } diff --git a/ApartmentManager/HousingWebAPI/Models/PastContractOwners.cs b/ApartmentManager/HousingWebApi/Models/PastContractOwner.cs index 0e6f3de..273952a 100644 --- a/ApartmentManager/HousingWebAPI/Models/PastContractOwners.cs +++ b/ApartmentManager/HousingWebApi/Models/PastContractOwner.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Models +namespace HousingWebApi  {      using System;      using System.Collections.Generic; @@ -6,7 +6,7 @@ namespace HousingWebAPI.Models      using System.ComponentModel.DataAnnotations.Schema;      using System.Data.Entity.Spatial; -    public partial class PastContractOwners +    public partial class PastContractOwner      {          [DatabaseGenerated(DatabaseGeneratedOption.None)]          public int Id { get; set; } diff --git a/ApartmentManager/HousingWebAPI/Models/Users.cs b/ApartmentManager/HousingWebApi/Models/Resident.cs index 0f6e693..367631c 100644 --- a/ApartmentManager/HousingWebAPI/Models/Users.cs +++ b/ApartmentManager/HousingWebApi/Models/Resident.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Models +namespace HousingWebApi  {      using System;      using System.Collections.Generic; @@ -6,33 +6,33 @@ namespace HousingWebAPI.Models      using System.ComponentModel.DataAnnotations.Schema;      using System.Data.Entity.Spatial; -    public partial class Users +    public partial class Resident      {          [Key]          [DatabaseGenerated(DatabaseGeneratedOption.None)] -        public int ResidentNumber { get; set; } +        public int ResidentNr { get; set; } + +        public int ApartmentNr { get; set; }          [Required]          [StringLength(15)] -        public string Name { get; set; } +        public string FirstName { get; set; }          [Required]          [StringLength(15)]          public string LastName { get; set; } -        public int? Phone { get; set; } -          [Column(TypeName = "date")]          public DateTime? BirthDate { get; set; } +        public int? Phone { get; set; } +          [StringLength(26)]          public string Email { get; set; }          [Column(TypeName = "image")]          public byte[] Picture { get; set; } -        public int ApartmentNr { get; set; } - -        public virtual Apartments Apartments { get; set; } +        public virtual Apartment Apartment { get; set; }      }  } diff --git a/ApartmentManager/HousingWebAPI/Models/Residents.cs b/ApartmentManager/HousingWebApi/Models/User.cs index 9e656c7..bce5318 100644 --- a/ApartmentManager/HousingWebAPI/Models/Residents.cs +++ b/ApartmentManager/HousingWebApi/Models/User.cs @@ -1,4 +1,4 @@ -namespace HousingWebAPI.Models +namespace HousingWebApi  {      using System;      using System.Collections.Generic; @@ -6,31 +6,38 @@ namespace HousingWebAPI.Models      using System.ComponentModel.DataAnnotations.Schema;      using System.Data.Entity.Spatial; -    public partial class Residents +    public partial class User      { -        [Key] -        [DatabaseGenerated(DatabaseGeneratedOption.None)] -        public int ResidentNumber { get; set; } +        [Required] +        [StringLength(15)] +        public string Username { get; set; }          [Required]          [StringLength(15)] -        public string Name { get; set; } +        public string Password { get; set; }          [Required]          [StringLength(15)] -        public string LastName { get; set; } +        public string FirstName { get; set; } -        public int? Phone { get; set; } +        [Required] +        [StringLength(15)] +        public string LastName { get; set; }          [Column(TypeName = "date")]          public DateTime? BirthDate { get; set; } +        [StringLength(12)] +        public string Phone { get; set; } +          [StringLength(26)]          public string Email { get; set; }          [Column(TypeName = "image")]          public byte[] Picture { get; set; } +        [Key] +        [DatabaseGenerated(DatabaseGeneratedOption.None)]          public int ApartmentNr { get; set; }          [StringLength(20)] @@ -47,12 +54,6 @@ namespace HousingWebAPI.Models          [StringLength(25)]          public string SecondEmail { get; set; } -        [StringLength(12)] -        public string Username { get; set; } - -        [StringLength(14)] -        public string Password { get; set; } - -        public virtual Apartments Apartments { get; set; } +        public virtual Apartment Apartment { get; set; }      }  }  |