This commit is contained in:
37
Models/Customer.cs
Normal file
37
Models/Customer.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class Customer
|
||||
{
|
||||
public Customer()
|
||||
{
|
||||
//Contact = new HashSet<Contact>();
|
||||
// Incident = new HashSet<Incident>();
|
||||
// Notification = new HashSet<Notification>();
|
||||
Purchase = new HashSet<Purchase>();
|
||||
Site = new HashSet<Site>();
|
||||
// Trial = new HashSet<Trial>();
|
||||
}
|
||||
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string StateProvince { get; set; }
|
||||
public string AffiliateNumber { get; set; }
|
||||
public bool DoNotContact { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public bool Active { get; set; }
|
||||
|
||||
public string SupportEmail { get; set; }
|
||||
public string AdminEmail { get; set; }
|
||||
|
||||
// public virtual ICollection<Contact> Contact { get; set; }
|
||||
// public virtual ICollection<Incident> Incident { get; set; }
|
||||
// public virtual ICollection<Notification> Notification { get; set; }
|
||||
public virtual ICollection<Purchase> Purchase { get; set; }
|
||||
public virtual ICollection<Site> Site { get; set; }
|
||||
// public virtual ICollection<Trial> Trial { get; set; }
|
||||
}
|
||||
}
|
||||
21
Models/License.cs
Normal file
21
Models/License.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class License
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long CustomerId { get; set; }
|
||||
public long DtCreated { get; set; }
|
||||
public string RegTo { get; set; }
|
||||
public string Key { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string FetchFrom { get; set; }
|
||||
public long? DtFetched { get; set; }
|
||||
public bool Fetched { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
18
Models/LicenseTemplates.cs
Normal file
18
Models/LicenseTemplates.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class LicenseTemplates
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string FullNew { get; set; }
|
||||
public string FullAddOn { get; set; }
|
||||
public string FullTrial { get; set; }
|
||||
public string FullTrialGreeting { get; set; }
|
||||
public string LiteNew { get; set; }
|
||||
public string LiteAddOn { get; set; }
|
||||
public string LiteTrial { get; set; }
|
||||
public string LiteTrialGreeting { get; set; }
|
||||
}
|
||||
}
|
||||
15
Models/Product.cs
Normal file
15
Models/Product.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class Product
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ProductCode { get; set; }
|
||||
public long Price { get; set; }//in cents
|
||||
public long RenewPrice { get; set; }//in cents
|
||||
|
||||
}
|
||||
}
|
||||
29
Models/Purchase.cs
Normal file
29
Models/Purchase.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class Purchase
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long CustomerId { get; set; }
|
||||
public long SiteId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string VendorName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string ProductCode { get; set; }
|
||||
public string SalesOrderNumber { get; set; }
|
||||
public long PurchaseDate { get; set; }
|
||||
public long? ExpireDate { get; set; }
|
||||
public long? CancelDate { get; set; }
|
||||
public string CouponCode { get; set; }
|
||||
public string Notes { get; set; }
|
||||
//schema v2
|
||||
public bool RenewNoticeSent { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual Customer Customer { get; set; }
|
||||
public virtual Site Site { get; set; }
|
||||
}
|
||||
}
|
||||
29
Models/RfCase.cs
Normal file
29
Models/RfCase.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class RfCase
|
||||
{
|
||||
|
||||
// public RfCase()
|
||||
// {
|
||||
// RfCaseBlob = new HashSet<RfCaseBlob>();
|
||||
// // RfCaseProject = new HashSet<RfCaseProject>();
|
||||
|
||||
// }
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public long RfCaseProjectId { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public long? DtCreated { get; set; }
|
||||
public long? DtClosed { get; set; }
|
||||
public string ReleaseVersion { get; set; }
|
||||
public string ReleaseNotes { get; set; }
|
||||
|
||||
|
||||
// public virtual RfCaseProject RfCaseProject { get; set; }
|
||||
//public virtual ICollection<RfCaseBlob> RfCaseBlob { get; set; }
|
||||
}
|
||||
}
|
||||
14
Models/RfCaseBlob.cs
Normal file
14
Models/RfCaseBlob.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class RfCaseBlob
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long? RfCaseId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public byte[] File { get; set; }
|
||||
public virtual RfCase RfCase { get; set; }
|
||||
}
|
||||
}
|
||||
19
Models/RfCaseProject.cs
Normal file
19
Models/RfCaseProject.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class RfCaseProject
|
||||
{
|
||||
|
||||
// public RfCaseProject()
|
||||
// {
|
||||
// RfCase = new HashSet<RfCase>();
|
||||
// }
|
||||
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
// public virtual ICollection<RfCase> RfCase { get; set; }
|
||||
}
|
||||
}
|
||||
39
Models/Site.cs
Normal file
39
Models/Site.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class Site
|
||||
{
|
||||
public Site()
|
||||
{
|
||||
// Incident = new HashSet<Incident>();
|
||||
Purchase = new HashSet<Purchase>();
|
||||
//TrialNavigation = new HashSet<Trial>();
|
||||
}
|
||||
|
||||
public long Id { get; set; }
|
||||
|
||||
public long CustomerId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string StateProvince { get; set; }
|
||||
public bool Trial { get; set; }
|
||||
public long? TrialStartDate { get; set; }
|
||||
public string TrialNotes { get; set; }
|
||||
public bool Networked { get; set; }
|
||||
public bool Hosted { get; set; }
|
||||
public string HostName { get; set; }
|
||||
public long? HostingStartDate { get; set; }
|
||||
public long? HostingEndDate { get; set; }
|
||||
public string DbType { get; set; }
|
||||
public string ServerOs { get; set; }
|
||||
public string ServerBits { get; set; }
|
||||
public string Notes { get; set; }
|
||||
|
||||
// public virtual ICollection<Incident> Incident { get; set; }
|
||||
public virtual ICollection<Purchase> Purchase { get; set; }
|
||||
// public virtual ICollection<Trial> TrialNavigation { get; set; }
|
||||
public virtual Customer Customer { get; set; }
|
||||
}
|
||||
}
|
||||
12
Models/TextTemplate.cs
Normal file
12
Models/TextTemplate.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class TextTemplate
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Template { get; set; }
|
||||
}
|
||||
}
|
||||
17
Models/User.cs
Normal file
17
Models/User.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class User
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Login { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Salt { get; set; }
|
||||
public string DlKey { get; set; }
|
||||
public long? DlKeyExp { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
68
Models/dtoKeyOptions.cs
Normal file
68
Models/dtoKeyOptions.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public class dtoKeyOptions
|
||||
{
|
||||
|
||||
public bool keyWillLockout { get; set; }
|
||||
public long? lockoutDate { get; set; }
|
||||
public bool isLite { get; set; }
|
||||
public string licenseType { get; set; }
|
||||
public string registeredTo { get; set; }
|
||||
public int users { get; set; }
|
||||
public long? supportExpiresDate { get; set; }
|
||||
public bool wbi { get; set; }
|
||||
public long? wbiSupportExpiresDate { get; set; }
|
||||
public bool mbi { get; set; }
|
||||
public long? mbiSupportExpiresDate { get; set; }
|
||||
public bool ri { get; set; }
|
||||
public long? riSupportExpiresDate { get; set; }
|
||||
public bool qbi { get; set; }
|
||||
public long? qbiSupportExpiresDate { get; set; }
|
||||
public bool qboi { get; set; }
|
||||
public long? qboiSupportExpiresDate { get; set; }
|
||||
public bool pti { get; set; }
|
||||
public long? ptiSupportExpiresDate { get; set; }
|
||||
public bool quickNotification { get; set; }
|
||||
public long? quickNotificationSupportExpiresDate { get; set; }
|
||||
public bool exportToXls { get; set; }
|
||||
public long? exportToXlsSupportExpiresDate { get; set; }
|
||||
public bool outlookSchedule { get; set; }
|
||||
public long? outlookScheduleSupportExpiresDate { get; set; }
|
||||
public bool oli { get; set; }
|
||||
public long? oliSupportExpiresDate { get; set; }
|
||||
public bool importExportCSVDuplicate { get; set; }
|
||||
public long? importExportCSVDuplicateSupportExpiresDate { get; set; }
|
||||
public string key { get; set; }
|
||||
|
||||
//case 3233
|
||||
public string emailAddress{get;set;}
|
||||
public string fetchCode{get;set;}
|
||||
public long customerId{get;set;}//always a valid ID or zero for a trial (no customer) key
|
||||
|
||||
//dynamically generated, not from request
|
||||
public string authorizedUserKeyGeneratorStamp { get; set; }
|
||||
public DateTime installByDate{get;set;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
{"keyWillLockout":"false","lockoutDate":"2017-08-10","isLite":"false","licenseType":"new","registeredTo":"MyTestCompany","users":"1",
|
||||
"supportExpiresDate":"2018-07-10","wbi":"false","wbiSupportExpiresDate":"2018-07-10","mbi":"false","mbiSupportExpiresDate":"2018-07-10",
|
||||
"ri":"false","riSupportExpiresDate":"2018-07-10","qbi":"false","qbiSupportExpiresDate":"2018-07-10","qboi":"false",
|
||||
"qboiSupportExpiresDate":"2018-07-10","pti":"false","ptiSupportExpiresDate":"2018-07-10",
|
||||
"quickNotification":"false","quickNotificationSupportExpiresDate":"2018-07-10","exportToXls":"false","exportToXlsSupportExpiresDate":"2018-07-10",
|
||||
"outlookSchedule":"false","outlookScheduleSupportExpiresDate":"2018-07-10","oli":"false","oliSupportExpiresDate":"2018-07-10",
|
||||
"importExportCSVDuplicate":"false","importExportCSVDuplicateSupportExpiresDate":"2018-07-10","key":""}
|
||||
*/
|
||||
18
Models/dtoKeyRequestResponse.cs
Normal file
18
Models/dtoKeyRequestResponse.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
//DTO class for license request key response form submission handling
|
||||
public class dtoKeyRequestResponse
|
||||
{
|
||||
public string greeting { get; set; }
|
||||
public string greetingReplySubject { get; set; }
|
||||
public string keycode { get; set; }
|
||||
public string request { get; set; }
|
||||
public string requestReplyToAddress { get; set; }
|
||||
public string requestFromReplySubject { get; set; }
|
||||
public uint request_email_uid { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
15
Models/dtoLicenseListItem.cs
Normal file
15
Models/dtoLicenseListItem.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
//Used to populate list routes for return
|
||||
public class dtoLicenseListItem
|
||||
{
|
||||
public long id;
|
||||
public long created;
|
||||
public string regto;
|
||||
public bool fetched;
|
||||
public bool trial;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
10
Models/dtoNameIdActiveItem.cs
Normal file
10
Models/dtoNameIdActiveItem.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
//Used to populate list routes for return
|
||||
public class dtoNameIdActiveItem
|
||||
{
|
||||
public bool active;
|
||||
public long id;
|
||||
public string name;
|
||||
}
|
||||
}
|
||||
18
Models/dtoNameIdChildrenItem.cs
Normal file
18
Models/dtoNameIdChildrenItem.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
//Used to populate list routes for return
|
||||
public class dtoNameIdChildrenItem
|
||||
{
|
||||
public dtoNameIdChildrenItem()
|
||||
{
|
||||
children = new List<dtoNameIdItem>();
|
||||
}
|
||||
public long id;
|
||||
public string name;
|
||||
public List<dtoNameIdItem> children;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
9
Models/dtoNameIdItem.cs
Normal file
9
Models/dtoNameIdItem.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
//Used to populate list routes for return
|
||||
public class dtoNameIdItem
|
||||
{
|
||||
public long id;
|
||||
public string name;
|
||||
}
|
||||
}
|
||||
532
Models/rockfishContext.cs
Normal file
532
Models/rockfishContext.cs
Normal file
@@ -0,0 +1,532 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using rockfishCore.Util;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace rockfishCore.Models
|
||||
{
|
||||
public partial class rockfishContext : DbContext
|
||||
{
|
||||
|
||||
|
||||
public virtual DbSet<Customer> Customer { get; set; }
|
||||
public virtual DbSet<LicenseTemplates> LicenseTemplates { get; set; }
|
||||
public virtual DbSet<Purchase> Purchase { get; set; }
|
||||
public virtual DbSet<Site> Site { get; set; }
|
||||
public virtual DbSet<User> User { get; set; }
|
||||
|
||||
//schema 2
|
||||
public virtual DbSet<Product> Product { get; set; }
|
||||
|
||||
//schema 4
|
||||
public virtual DbSet<TextTemplate> TextTemplate { get; set; }
|
||||
|
||||
//schema 6
|
||||
public virtual DbSet<RfCase> RfCase { get; set; }
|
||||
public virtual DbSet<RfCaseBlob> RfCaseBlob { get; set; }
|
||||
public virtual DbSet<RfCaseProject> RfCaseProject { get; set; }
|
||||
|
||||
//schema 10 case 3233
|
||||
public virtual DbSet<License> License { get; set; }
|
||||
|
||||
|
||||
|
||||
//Note: had to add this constructor to work with the code in startup.cs that gets the connection string from the appsettings.json file
|
||||
//and commented out the above on configuring
|
||||
public rockfishContext(DbContextOptions<rockfishContext> options) : base(options)
|
||||
{ }
|
||||
|
||||
//************************************************
|
||||
//add logging to diagnose sql errors
|
||||
//TODO:comment out this entire method in production
|
||||
// protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
// {
|
||||
// var lf = new LoggerFactory();
|
||||
// lf.AddProvider(new rfLoggerProvider());
|
||||
// optionsBuilder.UseLoggerFactory(lf);
|
||||
// optionsBuilder.EnableSensitiveDataLogging();//show parameters in log text
|
||||
// }
|
||||
//************************************************
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Customer>(entity =>
|
||||
{
|
||||
entity.ToTable("customer");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.AffiliateNumber)
|
||||
.HasColumnName("affiliateNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Country)
|
||||
.HasColumnName("country")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.DoNotContact)
|
||||
.IsRequired()
|
||||
.HasColumnName("doNotContact")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Notes)
|
||||
.HasColumnName("notes")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.StateProvince)
|
||||
.HasColumnName("stateProvince")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Active)
|
||||
.IsRequired()
|
||||
.HasColumnName("active")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
entity.Property(e => e.AdminEmail)
|
||||
.HasColumnName("adminEmail")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.SupportEmail)
|
||||
.HasColumnName("supportEmail")
|
||||
.HasColumnType("text");
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
modelBuilder.Entity<LicenseTemplates>(entity =>
|
||||
{
|
||||
entity.ToTable("licenseTemplates");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.FullAddOn)
|
||||
.HasColumnName("fullAddOn")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.FullNew)
|
||||
.HasColumnName("fullNew")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.FullTrial)
|
||||
.HasColumnName("fullTrial")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.FullTrialGreeting)
|
||||
.HasColumnName("fullTrialGreeting")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.LiteAddOn)
|
||||
.HasColumnName("liteAddOn")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.LiteNew)
|
||||
.HasColumnName("liteNew")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.LiteTrial)
|
||||
.HasColumnName("liteTrial")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.LiteTrialGreeting)
|
||||
.HasColumnName("liteTrialGreeting")
|
||||
.HasColumnType("text");
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<Purchase>(entity =>
|
||||
{
|
||||
entity.ToTable("purchase");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.CancelDate)
|
||||
.HasColumnName("cancelDate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.CouponCode)
|
||||
.HasColumnName("couponCode")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.CustomerId)
|
||||
.HasColumnName("customer_id")
|
||||
.HasColumnType("integer")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.Email)
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.ExpireDate)
|
||||
.HasColumnName("expireDate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Notes)
|
||||
.HasColumnName("notes")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.ProductCode)
|
||||
.HasColumnName("productCode")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.PurchaseDate)
|
||||
.HasColumnName("purchaseDate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.SalesOrderNumber)
|
||||
.HasColumnName("salesOrderNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.SiteId)
|
||||
.HasColumnName("site_id")
|
||||
.HasColumnType("integer")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.VendorName)
|
||||
.HasColumnName("vendorName")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.RenewNoticeSent)
|
||||
.IsRequired()
|
||||
.HasColumnName("renewNoticeSent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
entity.HasOne(d => d.Customer)
|
||||
.WithMany(p => p.Purchase)
|
||||
.HasForeignKey(d => d.CustomerId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
entity.HasOne(d => d.Site)
|
||||
.WithMany(p => p.Purchase)
|
||||
.HasForeignKey(d => d.SiteId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Site>(entity =>
|
||||
{
|
||||
entity.ToTable("site");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.Country)
|
||||
.HasColumnName("country")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.CustomerId)
|
||||
.HasColumnName("customer_id")
|
||||
.HasColumnType("integer")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.DbType)
|
||||
.HasColumnName("dbType")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.HostName)
|
||||
.HasColumnName("hostName")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Hosted)
|
||||
.IsRequired()
|
||||
.HasColumnName("hosted")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
entity.Property(e => e.HostingEndDate)
|
||||
.HasColumnName("hostingEndDate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.HostingStartDate)
|
||||
.HasColumnName("hostingStartDate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Networked)
|
||||
.IsRequired()
|
||||
.HasColumnName("networked")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
entity.Property(e => e.Notes)
|
||||
.HasColumnName("notes")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.ServerBits)
|
||||
.HasColumnName("serverBits")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.ServerOs)
|
||||
.HasColumnName("serverOS")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.StateProvince)
|
||||
.HasColumnName("stateProvince")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Trial)
|
||||
.IsRequired()
|
||||
.HasColumnName("trial")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
entity.Property(e => e.TrialNotes)
|
||||
.HasColumnName("trialNotes")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.TrialStartDate)
|
||||
.HasColumnName("trialStartDate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.HasOne(d => d.Customer)
|
||||
.WithMany(p => p.Site)
|
||||
.HasForeignKey(d => d.CustomerId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
//.WillCascadeOnDelete(true);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<User>(entity =>
|
||||
{
|
||||
entity.ToTable("user");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.Login)
|
||||
.IsRequired()
|
||||
.HasColumnName("login")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.DlKey)
|
||||
.HasColumnName("dlkey")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.DlKeyExp)
|
||||
.HasColumnName("dlkeyexp")
|
||||
.HasColumnType("integer");
|
||||
});
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<Product>(entity =>
|
||||
{
|
||||
entity.ToTable("Product");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.ProductCode)
|
||||
.HasColumnName("productCode")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Price)
|
||||
.HasColumnName("price")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.RenewPrice)
|
||||
.HasColumnName("renewPrice")
|
||||
.HasColumnType("integer");
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<TextTemplate>(entity =>
|
||||
{
|
||||
entity.ToTable("TextTemplate");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Template)
|
||||
.HasColumnName("template")
|
||||
.HasColumnType("text");
|
||||
|
||||
});
|
||||
|
||||
|
||||
//Schema 6 case 3308
|
||||
modelBuilder.Entity<RfCaseProject>(entity =>
|
||||
{
|
||||
entity.ToTable("rfcaseproject");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
// entity.HasOne(cp => cp.RfCase)
|
||||
// .WithMany();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<RfCaseBlob>(entity =>
|
||||
{
|
||||
entity.ToTable("rfcaseblob");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.RfCaseId)
|
||||
.HasColumnName("rfcaseid")
|
||||
.HasColumnType("integer")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.Name)
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.File)
|
||||
.HasColumnName("file")
|
||||
.HasColumnType("blob")
|
||||
.IsRequired();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<RfCase>(entity =>
|
||||
{
|
||||
entity.ToTable("rfcase");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.Title)
|
||||
.HasColumnName("title")
|
||||
.HasColumnType("text")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.RfCaseProjectId)
|
||||
.HasColumnName("rfcaseprojectid")
|
||||
.HasColumnType("integer")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.Priority)
|
||||
.IsRequired()
|
||||
.HasColumnName("priority")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.Notes)
|
||||
.HasColumnName("notes")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.DtCreated)
|
||||
.HasColumnName("dtcreated")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.DtClosed)
|
||||
.HasColumnName("dtclosed")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.ReleaseVersion)
|
||||
.HasColumnName("releaseversion")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.ReleaseNotes)
|
||||
.HasColumnName("releasenotes")
|
||||
.HasColumnType("text");
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//case 3233
|
||||
modelBuilder.Entity<License>(entity =>
|
||||
{
|
||||
entity.ToTable("license");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
|
||||
entity.Property(e => e.DtCreated)
|
||||
.HasColumnName("dtcreated")
|
||||
.HasColumnType("integer")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.Code)
|
||||
.HasColumnName("code")
|
||||
.HasColumnType("text")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.CustomerId)
|
||||
.HasColumnName("customerid")
|
||||
.HasColumnType("integer")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.DtFetched)
|
||||
.HasColumnName("dtfetched")
|
||||
.HasColumnType("integer");
|
||||
|
||||
entity.Property(e => e.Email)
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.RegTo)
|
||||
.HasColumnName("regto")
|
||||
.HasColumnType("text")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.Fetched)
|
||||
.HasColumnName("fetched")
|
||||
.HasColumnType("boolean")
|
||||
.IsRequired();
|
||||
|
||||
entity.Property(e => e.FetchFrom)
|
||||
.HasColumnName("fetchfrom")
|
||||
.HasColumnType("text");
|
||||
|
||||
entity.Property(e => e.Key)
|
||||
.HasColumnName("key")
|
||||
.HasColumnType("text")
|
||||
.IsRequired();
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
//-----------
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user