using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Security.Claims; using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; namespace Church.Net.Entity { public class FamilyMember : IdentityUser { public FamilyMember() { } [StringLength(50)] public string FirstName { get; set; } [StringLength(50)] public string LastName { get; set; } public Enumeration.Gender Gender { get; set; } [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] public DateTime Birthday { get; set; } public bool Married { get; set; } [System.ComponentModel.DataAnnotations.Schema.NotMapped] public bool Baptized { get; set; } public DateTime? DateOfBaptized { get; set; } [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] public DateTime DateOfWalkIn { get; set; } [StringLength(500)] public string Address { get; set; } [StringLength(50)] public string ComunityAppId { get; set; } [ForeignKey("Career")] public string CareerId { get; set; } public Career Career { get; set; } public virtual ICollection PastoralDomains { get; set; } public async Task GenerateUserIdentityAsync(UserManager manager) { // 注意 authenticationType 必須符合 CookieAuthenticationOptions.AuthenticationType 中定義的項目 var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); // 在這裡新增自訂使用者宣告 return userIdentity; } } public class FamilyUserRole : IdentityUserRole { } public class FamilyRole : IdentityRole { } public class FamilyClaim : IdentityUserClaim { } public class FamilyLogin : IdentityUserLogin { } }