Adding EF initialization

This commit is contained in:
2016-01-29 11:25:44 -05:00
parent 37a7a24436
commit 68a77366e9
25 changed files with 2534 additions and 29 deletions
+6 -1
View File
@@ -1,7 +1,12 @@
namespace LeafWeb.Core.Models
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LeafWeb.Core.Models
{
public class FluxnetSite
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public string FluxnetId { get; set; }
public string SiteName { get; set; }
+2 -3
View File
@@ -6,10 +6,9 @@ namespace LeafWeb.Core.Models
{
public class LeafInput
{
[Key]
public int LeafInputId { get; set; }
public int Id { get; set; }
public virtual IEnumerable<LeafInputFile> LeafInputFiles { get; set; }
public virtual ICollection<LeafInputFile> LeafInputFiles { get; set; }
[Required(ErrorMessage = "Name required")]
public string Name { get; set; }
+1 -2
View File
@@ -8,8 +8,7 @@ namespace LeafWeb.Core.Models
/// </summary>
public class LeafInputData
{
[Key]
public int LeafInputDataId { get; set; }
public int Id { get; set; }
public virtual LeafInputInfo LeafInputInfo { get; set; }
+5 -3
View File
@@ -4,12 +4,14 @@ namespace LeafWeb.Core.Models
{
public class LeafInputFile
{
[Key]
public int LeafInputFileId { get; set; }
public int Id { get; set; }
public virtual LeafInput LeafInput { get; set; }
public virtual LeafInputInfo LeafInputInfo { get; set; }
/// <summary>
/// Parsed values from the LeafInput used in LeafWeb for filtering/searching
/// </summary>
// public virtual LeafInputInfo LeafInputInfo { get; set; }
public string Filename { get; set; }
+2 -3
View File
@@ -10,12 +10,11 @@ namespace LeafWeb.Core.Models
/// </summary>
public class LeafInputInfo
{
[Key]
public int LeafInputInfoId { get; set; }
public int Id { get; set; }
public virtual LeafInputSite Site { get; set; }
public virtual LeafInputPhotosynthetic Photosynthetic { get; set; }
public virtual IEnumerable<LeafInputData> Data { get; set; }
public virtual ICollection<LeafInputData> Data { get; set; }
[ParseInfo(1, exampleValue: "First and last name")]
public string InvestigatorName { get; set; }
+1 -2
View File
@@ -9,8 +9,7 @@ namespace LeafWeb.Core.Models
/// </summary>
public class LeafInputPhotosynthetic
{
[Key]
public int LeafInputPhotosyntheticId { get; set; }
public int Id { get; set; }
public virtual LeafInputInfo LeafInputInfo { get; set; }
+1 -2
View File
@@ -9,8 +9,7 @@ namespace LeafWeb.Core.Models
/// </summary>
public class LeafInputSite
{
[Key]
public int LeafInputSiteId { get; set; }
public int Id { get; set; }
public virtual LeafInputInfo LeafInputInfo { get; set; }