From 7a529c5fe917020a6c7e64904a1ffd4100bab5a7 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Tue, 30 May 2017 15:47:31 +0200 Subject: Added managing changes for board members. --- .../ApartmentManager/ApartmentManager.csproj | 26 ++++ ApartmentManager/ApartmentManager/AppShell.xaml.cs | 4 +- .../ApartmentManager/Handler/BmChangesHandler.cs | 143 +++++++++++++++++++++ .../ApartmentManager/Handler/LoginHandler.cs | 2 + .../ApartmentManager/Model/ApartmentChange.cs | 50 +++++++ .../ApartmentManager/Model/ChangeComment.cs | 13 ++ .../ApartmentManager/Model/ChangeDocument.cs | 9 ++ .../ApartmentManager/Singletons/BmSingleton.cs | 3 + .../ApartmentManager/View/BmChangesPage.xaml | 137 +++++++++++++++++++- .../ApartmentManager/View/BmChangesPage.xaml.cs | 33 +++-- .../ApartmentManager/View/BmCreateChangePage.xaml | 97 ++++++++++++++ .../View/BmCreateChangePage.xaml.cs | 30 +++++ .../ApartmentManager/View/BmEditChangePage.xaml | 108 ++++++++++++++++ .../ApartmentManager/View/BmEditChangePage.xaml.cs | 30 +++++ .../ApartmentManager/View/BmSingleChangePage.xaml | 135 +++++++++++++++++++ .../View/BmSingleChangePage.xaml.cs | 30 +++++ .../ViewModel/BmChangesViewModel.cs | 106 +++++++++++++++ .../Controllers/ChangeCommentsController.cs | 10 ++ .../Controllers/ChangeDocumentsController.cs | 10 ++ ApartmentManager/HousingWebApi/DataModel.cs | 10 -- .../HousingWebApi/HousingWebApi.csproj | 6 +- .../HousingWebApi/Models/ApartmentChange.cs | 1 - .../HousingWebApi/Models/ChangeComment.cs | 1 - .../HousingWebApi/Models/ChangeDocument.cs | 1 - 24 files changed, 959 insertions(+), 36 deletions(-) create mode 100644 ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs create mode 100644 ApartmentManager/ApartmentManager/Model/ApartmentChange.cs create mode 100644 ApartmentManager/ApartmentManager/Model/ChangeComment.cs create mode 100644 ApartmentManager/ApartmentManager/Model/ChangeDocument.cs create mode 100644 ApartmentManager/ApartmentManager/View/BmCreateChangePage.xaml create mode 100644 ApartmentManager/ApartmentManager/View/BmCreateChangePage.xaml.cs create mode 100644 ApartmentManager/ApartmentManager/View/BmEditChangePage.xaml create mode 100644 ApartmentManager/ApartmentManager/View/BmEditChangePage.xaml.cs create mode 100644 ApartmentManager/ApartmentManager/View/BmSingleChangePage.xaml create mode 100644 ApartmentManager/ApartmentManager/View/BmSingleChangePage.xaml.cs create mode 100644 ApartmentManager/ApartmentManager/ViewModel/BmChangesViewModel.cs diff --git a/ApartmentManager/ApartmentManager/ApartmentManager.csproj b/ApartmentManager/ApartmentManager/ApartmentManager.csproj index 44f97b5..e8a52ff 100644 --- a/ApartmentManager/ApartmentManager/ApartmentManager.csproj +++ b/ApartmentManager/ApartmentManager/ApartmentManager.csproj @@ -101,12 +101,16 @@ + + + + @@ -121,6 +125,7 @@ + @@ -141,12 +146,18 @@ BmChangesPage.xaml + + BmCreateChangePage.xaml + BmCreateDefectPage.xaml BmEditApartmentPage.xaml + + BmEditChangePage.xaml + BmEditDefectPage.xaml @@ -165,6 +176,9 @@ BmCreateApartmentPage.xaml + + BmSingleChangePage.xaml + BmSingleDefectPage.xaml @@ -229,6 +243,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -237,6 +255,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -261,6 +283,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml.cs b/ApartmentManager/ApartmentManager/AppShell.xaml.cs index 7332ad7..c5fcfe5 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml.cs +++ b/ApartmentManager/ApartmentManager/AppShell.xaml.cs @@ -69,7 +69,7 @@ namespace ApartmentManager new NavMenuItem() { - Symbol = Symbol.Comment, + Symbol = Symbol.Bookmarks, Label = "Apartments", DestPage = typeof(BmApartmentsPage), IsSelected = false @@ -77,7 +77,7 @@ namespace ApartmentManager new NavMenuItem() { - Symbol = Symbol.Comment, + Symbol = Symbol.Bookmarks, Label = "Contract owners", DestPage = typeof(BmUsersPage), IsSelected = false diff --git a/ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs b/ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs new file mode 100644 index 0000000..a32bbc2 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs @@ -0,0 +1,143 @@ +using ApartmentManager.Model; +using ApartmentManager.Persistency; +using ApartmentManager.Singletons; +using ApartmentManager.ViewModel; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Windows.UI.Popups; + +namespace ApartmentManager.Handler +{ + public class BmChangesHandler + { + private BmChangesViewModel _vm; + + public BmChangesHandler(BmChangesViewModel vm) + { + _vm = vm; + } + + public void GetChanges() + { + var changes = JsonConvert.DeserializeObject>(ApiClient.GetData("api/ApartmentChanges/")); + BmSingleton.Instance.ApartmentChanges.Clear(); + foreach (var change in changes) + { + change.Documents = JsonConvert.DeserializeObject>(ApiClient.GetData("api/ChangeDocumentsById/" + change.ChangeId)); + change.Comments = JsonConvert.DeserializeObject>(ApiClient.GetData("api/ChangeCommentsById/" + change.ChangeId)); + BmSingleton.Instance.ApartmentChanges.Add(change); + } + } + + public void CreateChange() + { + try + { + _vm.ChangeTemplate.Status = "New"; + _vm.ChangeTemplate.UploadDate = DateTime.Now; + if (_vm.ChangeTemplate.Documents == null) _vm.ChangeTemplate.Documents = new ObservableCollection(); + var response = JsonConvert.DeserializeObject(ApiClient.PostData("api/ApartmentChanges/", _vm.ChangeTemplate)); + foreach (var changeDocument in _vm.ChangeTemplate.Documents) + { + changeDocument.ChangeId = response.ChangeId; + ApiClient.PostData("api/ChangeDocuments/", changeDocument); + } + GetChanges(); + _vm.ChangeTemplate = new ApartmentChange(); + } + catch (Exception e) + { + var msg = new MessageDialog(e.Message).ShowAsync(); + } + } + public void UpdateChange() + { + try + { + ApiClient.PutData("api/ApartmentChanges/" + _vm.ChangeTemplate.ChangeId, _vm.ChangeTemplate); + var deletedChangeDocuments = new List(_vm.DeletedChangeDocuments); + var addedChangeDocuments = new List(_vm.AddedChangeDocuments); + + foreach (var changeDocument in deletedChangeDocuments) + { + ApiClient.DeleteData("api/ChangeDocuments/" + changeDocument.DocumentId); + _vm.DeletedChangeDocuments.Remove(changeDocument); + } + foreach (var changeDocument in addedChangeDocuments) + { + changeDocument.ChangeId = _vm.ChangeTemplate.ChangeId; + ApiClient.PostData("api/ChangeDocuments", changeDocument); + _vm.AddedChangeDocuments.Remove(changeDocument); + } + GetChanges(); + } + catch (Exception e) + { + var msg = new MessageDialog(e.Message).ShowAsync(); + } + } + public void DeleteChange() + { + try + { + ApiClient.DeleteData("api/ApartmentChanges/" + _vm.ChangeTemplate.ChangeId); + BmSingleton.Instance.ApartmentChanges.Remove(_vm.ChangeTemplate); + GetChanges(); + } + catch (Exception e) + { + var msg = new MessageDialog(e.Message).ShowAsync(); + } + } + + public void ClearChangeTemplate() + { + _vm.ChangeTemplate = new ApartmentChange(); + } + + public async void UploadChangeDocument() + { + if (_vm.ChangeTemplate.Documents == null) _vm.ChangeTemplate.Documents = new ObservableCollection(); + var document = new ChangeDocument() { Document = await ImgurPhotoUploader.UploadPhotoAsync() }; + _vm.ChangeTemplate.Documents.Add(document); + _vm.AddedChangeDocuments.Add(document); + } + + public void DeleteChangeDocument() + { + _vm.ChangeTemplate.Documents.Remove(_vm.SelectedChangeDocument); + } + + public void DeleteChangeDocumentTemp() + { + _vm.DeletedChangeDocuments.Add(_vm.SelectedChangeDocument); + _vm.ChangeTemplate.Documents.Remove(_vm.SelectedChangeDocument); + } + + public void CreateChangeComment() + { + try + { + var comment = new ChangeComment() + { + Comment = _vm.NewChangeComment.Comment, + ChangeId = _vm.ChangeTemplate.ChangeId, + Name = UserSingleton.Instance.CurrentUser.FirstName + " " + UserSingleton.Instance.CurrentUser.LastName, + Date = DateTimeOffset.Now + }; + if (!string.IsNullOrEmpty(comment.Comment)) + { + ApiClient.PostData("api/ChangeComments/", comment); + _vm.ChangeTemplate.Comments.Add(comment); + _vm.NewChangeComment = new ChangeComment(); + } + } + catch (Exception e) + { + var msg = new MessageDialog(e.Message).ShowAsync(); + } + } + } +} diff --git a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs index 7db0ba4..9f52a40 100644 --- a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs @@ -79,10 +79,12 @@ namespace ApartmentManager.Handler BmUsersViewModel buvm = new BmUsersViewModel(); BmResidentsViewModel brvm = new BmResidentsViewModel(); BmDefectsViewModel bdvm = new BmDefectsViewModel(); + BmChangesViewModel bcvm = new BmChangesViewModel(); bavm.BmApartmentsHandler.GetApartments(); buvm.BmUsersHandler.GetUsers(); brvm.BmResidentsHandler.GetResidents(); bdvm.BmDefectsHandler.GetDefects(); + bcvm.BmChangesHandler.GetChanges(); appShell.AppFrame.Navigate(typeof(BmMainPage)); } else diff --git a/ApartmentManager/ApartmentManager/Model/ApartmentChange.cs b/ApartmentManager/ApartmentManager/Model/ApartmentChange.cs new file mode 100644 index 0000000..640112c --- /dev/null +++ b/ApartmentManager/ApartmentManager/Model/ApartmentChange.cs @@ -0,0 +1,50 @@ +using ApartmentManager.Annotations; +using ApartmentManager.Model; +using System; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace ApartmentManager +{ + public class ApartmentChange + { + public int ChangeId { get; set; } + public int ApartmentId { get; set; } + public string Name { get; set; } + public DateTime UploadDate { get; set; } + public string Description { get; set; } + public string Status { get; set; } + private ObservableCollection _documents; + private ObservableCollection _comments; + + public ObservableCollection Documents + { + get => _documents; + set + { + _documents = value; + OnPropertyChanged(nameof(Documents)); + } + } + + public ObservableCollection Comments + { + get => _comments; + set + { + _comments = value; + OnPropertyChanged(nameof(Comments)); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + [NotifyPropertyChangedInvocator] + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + + } + } +} diff --git a/ApartmentManager/ApartmentManager/Model/ChangeComment.cs b/ApartmentManager/ApartmentManager/Model/ChangeComment.cs new file mode 100644 index 0000000..314cd50 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Model/ChangeComment.cs @@ -0,0 +1,13 @@ +using System; + +namespace ApartmentManager.Model +{ + public class ChangeComment + { + public int CommentId { get; set; } + public int ChangeId { get; set; } + public string Comment { get; set; } + public string Name { get; set; } + public DateTimeOffset Date { get; set; } + } +} diff --git a/ApartmentManager/ApartmentManager/Model/ChangeDocument.cs b/ApartmentManager/ApartmentManager/Model/ChangeDocument.cs new file mode 100644 index 0000000..6da6a39 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Model/ChangeDocument.cs @@ -0,0 +1,9 @@ +namespace ApartmentManager.Model +{ + public class ChangeDocument + { + public int DocumentId { get; set; } + public int ChangeId { get; set; } + public string Document { get; set; } + } +} diff --git a/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs index 5ee5019..c12f852 100644 --- a/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs @@ -12,12 +12,15 @@ namespace ApartmentManager.Singletons public ObservableCollection Users { get; set; } public ObservableCollection Residents { get; set; } public ObservableCollection Defects { get; set; } + public ObservableCollection ApartmentChanges { get; set; } private BmSingleton() { + Apartments = new ObservableCollection(); Users = new ObservableCollection(); Residents = new ObservableCollection(); Defects = new ObservableCollection(); + ApartmentChanges = new ObservableCollection(); } } } diff --git a/ApartmentManager/ApartmentManager/View/BmChangesPage.xaml b/ApartmentManager/ApartmentManager/View/BmChangesPage.xaml index 6914288..215496b 100644 --- a/ApartmentManager/ApartmentManager/View/BmChangesPage.xaml +++ b/ApartmentManager/ApartmentManager/View/BmChangesPage.xaml @@ -2,10 +2,145 @@ x:Class="ApartmentManager.View.BmChangesPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:core="using:Microsoft.Xaml.Interactions.Core" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:interactivity="using:Microsoft.Xaml.Interactivity" xmlns:local="using:ApartmentManager.View" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:vm="using:ApartmentManager.ViewModel" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ApartmentManager/ApartmentManager/View/BmSingleChangePage.xaml.cs b/ApartmentManager/ApartmentManager/View/BmSingleChangePage.xaml.cs new file mode 100644 index 0000000..d4bcc40 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/BmSingleChangePage.xaml.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ApartmentManager.View +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class BmSingleChangePage : Page + { + public BmSingleChangePage() + { + this.InitializeComponent(); + } + } +} diff --git a/ApartmentManager/ApartmentManager/ViewModel/BmChangesViewModel.cs b/ApartmentManager/ApartmentManager/ViewModel/BmChangesViewModel.cs new file mode 100644 index 0000000..68aa14d --- /dev/null +++ b/ApartmentManager/ApartmentManager/ViewModel/BmChangesViewModel.cs @@ -0,0 +1,106 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Windows.Input; +using ApartmentManager.Annotations; +using ApartmentManager.Common; +using ApartmentManager.Model; +using ApartmentManager.Singletons; +using ApartmentManager.Handler; +using System.Collections.Generic; + +namespace ApartmentManager.ViewModel +{ + public class BmChangesViewModel : INotifyPropertyChanged + { + public BmSingleton BmSingleton { get; } = BmSingleton.Instance; + public BmChangesHandler BmChangesHandler { get; } + + public ICommand CreateChangeCommand { get; } + public ICommand DeleteChangeCommand { get; } + public ICommand UpdateChangeCommand { get; } + public ICommand ClearChangeTemplateCommand { get; } + public ICommand GetChangesCommand { get; } + public ICommand UploadChangeDocumentCommand { get; } + public ICommand UploadChangeDocumentTempCommand { get; } + public ICommand DeleteChangeDocumentCommand { get; } + public ICommand DeleteChangeDocumentTempCommand { get; } + public ICommand CreateChangeCommentCommand { get; } + + private static ApartmentChange _changeTemplate = new ApartmentChange(); + private static ChangeDocument _selectedChangeDocument = new ChangeDocument(); + private static List _deletedChangeDocuments = new List(); + private static List _addedChangeDocuments = new List(); + private static ChangeComment _newChangeComment = new ChangeComment(); + + public BmChangesViewModel() + { + BmChangesHandler = new BmChangesHandler(this); + + CreateChangeCommand = new RelayCommand(BmChangesHandler.CreateChange); + DeleteChangeCommand = new RelayCommand(BmChangesHandler.DeleteChange); + UpdateChangeCommand = new RelayCommand(BmChangesHandler.UpdateChange); + ClearChangeTemplateCommand = new RelayCommand(BmChangesHandler.ClearChangeTemplate); + UploadChangeDocumentCommand = new RelayCommand(BmChangesHandler.UploadChangeDocument); + DeleteChangeDocumentCommand = new RelayCommand(BmChangesHandler.DeleteChangeDocument); + DeleteChangeDocumentTempCommand = new RelayCommand(BmChangesHandler.DeleteChangeDocumentTemp); + GetChangesCommand = new RelayCommand(BmChangesHandler.GetChanges); + CreateChangeCommentCommand = new RelayCommand(BmChangesHandler.CreateChangeComment); + } + + public ApartmentChange ChangeTemplate + { + get => _changeTemplate; + set + { + _changeTemplate = value; + OnPropertyChanged(); + } + } + + public ChangeDocument SelectedChangeDocument + { + get => _selectedChangeDocument; + set + { + _selectedChangeDocument = value; + OnPropertyChanged(); + } + } + + public List DeletedChangeDocuments + { + get => _deletedChangeDocuments; + set + { + _deletedChangeDocuments = value; + } + } + + public List AddedChangeDocuments + { + get => _addedChangeDocuments; + set + { + _addedChangeDocuments = value; + } + } + + public ChangeComment NewChangeComment + { + get => _newChangeComment; + set + { + _newChangeComment = value; + OnPropertyChanged(); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + [NotifyPropertyChangedInvocator] + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/ApartmentManager/HousingWebApi/Controllers/ChangeCommentsController.cs b/ApartmentManager/HousingWebApi/Controllers/ChangeCommentsController.cs index bebff8e..11519fd 100644 --- a/ApartmentManager/HousingWebApi/Controllers/ChangeCommentsController.cs +++ b/ApartmentManager/HousingWebApi/Controllers/ChangeCommentsController.cs @@ -16,6 +16,16 @@ namespace HousingWebApi.Controllers { private DataModel db = new DataModel(); + //GET: api/ChangeCommentsById + [Route("api/ChangeCommentsById/{id}")] + public IQueryable GetChangeCommentsById(int id) + { + var commentsList = from changeComment in db.ChangeComments + where (changeComment.ChangeId == id) + select changeComment; + return commentsList; + } + // GET: api/ChangeComments public IQueryable GetChangeComments() { diff --git a/ApartmentManager/HousingWebApi/Controllers/ChangeDocumentsController.cs b/ApartmentManager/HousingWebApi/Controllers/ChangeDocumentsController.cs index 406ab33..0ffaec0 100644 --- a/ApartmentManager/HousingWebApi/Controllers/ChangeDocumentsController.cs +++ b/ApartmentManager/HousingWebApi/Controllers/ChangeDocumentsController.cs @@ -16,6 +16,16 @@ namespace HousingWebApi.Controllers { private DataModel db = new DataModel(); + //GET: api/ChangeDocumentsById + [Route("api/ChangeDocumentsById/{id}")] + public IQueryable GetChangeDocumentsById(int id) + { + var documentsList = from changeDocument in db.ChangeDocuments + where (changeDocument.ChangeId == id) + select changeDocument; + return documentsList; + } + // GET: api/ChangeDocuments public IQueryable GetChangeDocuments() { diff --git a/ApartmentManager/HousingWebApi/DataModel.cs b/ApartmentManager/HousingWebApi/DataModel.cs index 78fd1f2..aa2721f 100644 --- a/ApartmentManager/HousingWebApi/DataModel.cs +++ b/ApartmentManager/HousingWebApi/DataModel.cs @@ -106,16 +106,6 @@ namespace HousingWebApi .Property(e => e.Status) .IsUnicode(false); - modelBuilder.Entity() - .HasMany(e => e.DefectComments) - .WithRequired(e => e.Defect) - .WillCascadeOnDelete(false); - - modelBuilder.Entity() - .HasMany(e => e.DefectPictures) - .WithRequired(e => e.Defect) - .WillCascadeOnDelete(false); - modelBuilder.Entity() .Property(e => e.Comment) .IsUnicode(false); diff --git a/ApartmentManager/HousingWebApi/HousingWebApi.csproj b/ApartmentManager/HousingWebApi/HousingWebApi.csproj index 407d4b0..779dd08 100644 --- a/ApartmentManager/HousingWebApi/HousingWebApi.csproj +++ b/ApartmentManager/HousingWebApi/HousingWebApi.csproj @@ -151,10 +151,12 @@ - + + + @@ -187,8 +189,6 @@ - - diff --git a/ApartmentManager/HousingWebApi/Models/ApartmentChange.cs b/ApartmentManager/HousingWebApi/Models/ApartmentChange.cs index e14a35e..a3308f3 100644 --- a/ApartmentManager/HousingWebApi/Models/ApartmentChange.cs +++ b/ApartmentManager/HousingWebApi/Models/ApartmentChange.cs @@ -17,7 +17,6 @@ namespace HousingWebApi } [Key] - [DatabaseGenerated(DatabaseGeneratedOption.None)] public int ChangeId { get; set; } public int ApartmentId { get; set; } diff --git a/ApartmentManager/HousingWebApi/Models/ChangeComment.cs b/ApartmentManager/HousingWebApi/Models/ChangeComment.cs index b8ee58e..954d348 100644 --- a/ApartmentManager/HousingWebApi/Models/ChangeComment.cs +++ b/ApartmentManager/HousingWebApi/Models/ChangeComment.cs @@ -10,7 +10,6 @@ namespace HousingWebApi public partial class ChangeComment { [Key] - [DatabaseGenerated(DatabaseGeneratedOption.None)] public int CommentId { get; set; } public int ChangeId { get; set; } diff --git a/ApartmentManager/HousingWebApi/Models/ChangeDocument.cs b/ApartmentManager/HousingWebApi/Models/ChangeDocument.cs index 7e869df..320686f 100644 --- a/ApartmentManager/HousingWebApi/Models/ChangeDocument.cs +++ b/ApartmentManager/HousingWebApi/Models/ChangeDocument.cs @@ -10,7 +10,6 @@ namespace HousingWebApi public partial class ChangeDocument { [Key] - [DatabaseGenerated(DatabaseGeneratedOption.None)] public int DocumentId { get; set; } public int ChangeId { get; set; } -- cgit v1.2.3