This commit is contained in:
2018-09-05 23:13:07 +00:00
parent 0a3c927429
commit deee704135
2 changed files with 5 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using AyaNova.Biz;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace AyaNova.Models
{
@@ -39,6 +40,7 @@ namespace AyaNova.Models
//relations
//https://docs.microsoft.com/en-us/ef/core/modeling/relationships#other-relationship-patterns
[JsonIgnore]
public UserOptions UserOptions { get; set; }
}

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using AyaNova.Biz;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace AyaNova.Models
{
@@ -19,6 +20,7 @@ namespace AyaNova.Models
//relations
//https://docs.microsoft.com/en-us/ef/core/modeling/relationships#other-relationship-patterns
[JsonIgnore]
public User User { get; set; }
[Required]
public long UserId { get; set; }//will be auto-set by EF due to relationship defined
@@ -26,7 +28,7 @@ namespace AyaNova.Models
public UserOptions(long ownerId)
{
TimeZoneOffset = 0;
UiColor = 0;
OwnerId = ownerId;