This commit is contained in:
@@ -8,6 +8,7 @@ namespace AyaNova.Models
|
||||
{
|
||||
public partial class AyContext : DbContext
|
||||
{
|
||||
public virtual DbSet<Event> Event { get; set; }
|
||||
public virtual DbSet<User> User { get; set; }
|
||||
public virtual DbSet<License> License { get; set; }
|
||||
public virtual DbSet<Widget> Widget { get; set; }
|
||||
@@ -77,7 +78,7 @@ namespace AyaNova.Models
|
||||
//Relationships
|
||||
modelBuilder.Entity<Locale>()
|
||||
.HasMany(c => c.LocaleItems)
|
||||
.WithOne(e => e.Locale)
|
||||
.WithOne(e => e.Locale)
|
||||
.IsRequired();//default delete behaviour is cascade when set to isrequired
|
||||
|
||||
|
||||
|
||||
47
server/AyaNova/models/Event.cs
Normal file
47
server/AyaNova/models/Event.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using AyaNova.Biz;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Event log entry
|
||||
/// </summary>
|
||||
public partial class Event
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public uint ConcurrencyToken { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
[Required]
|
||||
public long OwnerId { get; set; }
|
||||
//-----------------------------------------
|
||||
[Required]
|
||||
public long AyId { get; set; }
|
||||
[Required]
|
||||
public AyaType AyType { get; set; }
|
||||
[Required]
|
||||
public AyaEvent AyEvent { get; set; }
|
||||
public string Textra { get; set; }
|
||||
|
||||
|
||||
public Event()
|
||||
{
|
||||
Created = System.DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public Event(long ownerId, long ayId, AyaType ayType, AyaEvent ayEvent, string textra = null)
|
||||
{
|
||||
Created = System.DateTime.UtcNow;
|
||||
OwnerId = ownerId;
|
||||
AyId = ayId;
|
||||
AyEvent = ayEvent;
|
||||
if (textra != null)
|
||||
{
|
||||
Textra = textra;
|
||||
}
|
||||
}
|
||||
|
||||
}//eoc
|
||||
|
||||
}//eons
|
||||
Reference in New Issue
Block a user