DocSpace-client/common/ASC.Core.Common/EF/Model/Tenant/DbQuotaRow.cs
2020-09-30 14:50:39 +03:00

36 lines
922 B
C#

using System;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF
{
[Table("tenants_quotarow")]
public class DbQuotaRow : BaseEntity
{
public int Tenant { get; set; }
public string Path { get; set; }
public long Counter { get; set; }
public string Tag { get; set; }
[Column("last_modified")]
public DateTime LastModified { get; set; }
public override object[] GetKeys()
{
return new object[] { Tenant, Path };
}
}
public static class DbQuotaRowExtension
{
public static ModelBuilder AddDbQuotaRow(this ModelBuilder modelBuilder)
{
_ = modelBuilder.Entity<DbQuotaRow>()
.HasKey(c => new { c.Tenant, c.Path });
return modelBuilder;
}
}
}