This commit is contained in:
parent
46f5c107b8
commit
fa34ed249b
233 changed files with 4000 additions and 1396 deletions
37
Yavsc/Model/Identity/ApplicationUser.cs
Normal file
37
Yavsc/Model/Identity/ApplicationUser.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
||||
// Add profile data for application users by adding properties to the ApplicationUser class
|
||||
public class ApplicationUser : IdentityUser
|
||||
{
|
||||
|
||||
[Display(Name="AccountBalance")]
|
||||
public virtual AccountBalance AccountBalance { get; set; }
|
||||
|
||||
[InverseProperty("Author")]
|
||||
public virtual List<Blog> Posts { get; set; }
|
||||
|
||||
[InverseProperty("Owner")]
|
||||
public virtual List<Contact> Book { get; set; }
|
||||
|
||||
[InverseProperty("DeviceOwner")]
|
||||
public virtual List<GoogleCloudMobileDeclaration> Devices { get; set; }
|
||||
|
||||
[InverseProperty("Owner")]
|
||||
|
||||
public virtual List<Circle> Circles { get; set; }
|
||||
public virtual Location PostalAddress { get; set; }
|
||||
|
||||
public string DedicatedGoogleCalendar { get; set; }
|
||||
|
||||
public override string ToString() {
|
||||
return this.Id+" "+this.AccountBalance?.Credits.ToString()+this.Email+" "+this.UserName+" $"+this.AccountBalance?.Credits.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Yavsc/Model/Identity/MobileAppDeclaration.cs
Normal file
36
Yavsc/Model/Identity/MobileAppDeclaration.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models;
|
||||
|
||||
public class GoogleCloudMobileDeclaration {
|
||||
[Key]
|
||||
|
||||
public string RegistrationId { get; set; }
|
||||
|
||||
public string DeviceOwnerId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("DeviceOwnerId")]
|
||||
public virtual ApplicationUser DeviceOwner { get; set; }
|
||||
|
||||
// override object.Equals
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var other = obj as GoogleCloudMobileDeclaration;
|
||||
return RegistrationId == other.RegistrationId
|
||||
&& Name == other.Name;
|
||||
}
|
||||
|
||||
// override object.GetHashCode
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (RegistrationId+Name).GetHashCode();
|
||||
}
|
||||
|
||||
}
|
||||
48
Yavsc/Model/Identity/OAuth2Tokens.cs
Normal file
48
Yavsc/Model/Identity/OAuth2Tokens.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// OffLine OAuth2 Token
|
||||
/// To use against the Google Calendar Api
|
||||
/// </summary>
|
||||
public partial class OAuth2Tokens
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique identifier, equals the user email from OAuth provider
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Key]
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Expiration date & time
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DateTime Expiration { get; set; }
|
||||
/// <summary>
|
||||
/// Expiration time span in seconds
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Should always be <c>Bearer</c> ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string TokenType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Access Token!
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The refresh token
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string RefreshToken { get; set; }
|
||||
}
|
||||
}
|
||||
11
Yavsc/Model/Identity/passwrecovery.cs
Normal file
11
Yavsc/Model/Identity/passwrecovery.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class passwrecovery
|
||||
{
|
||||
public string pkid { get; set; }
|
||||
public DateTime creation { get; set; }
|
||||
public string one_time_pass { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue