reorg
This commit is contained in:
parent
d000f77098
commit
40e8e08690
3487 changed files with 39 additions and 21 deletions
29
src/Yavsc.Server/Models/Relationship/Circle.cs
Normal file
29
src/Yavsc.Server/Models/Relationship/Circle.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public class Circle {
|
||||
|
||||
[Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public bool Public { get; set; }
|
||||
|
||||
[YaRequired]
|
||||
public string Name { get; set; }
|
||||
|
||||
[YaRequired]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId"),JsonIgnore,NotMapped]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[InverseProperty("Circle"),JsonIgnore]
|
||||
public virtual List<CircleMember> Members { get; set; }
|
||||
}
|
||||
}
|
||||
24
src/Yavsc.Server/Models/Relationship/CircleMember.cs
Normal file
24
src/Yavsc.Server/Models/Relationship/CircleMember.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
|
||||
public partial class CircleMember
|
||||
{
|
||||
|
||||
[YaRequired]
|
||||
public long CircleId { get; set; }
|
||||
|
||||
[ForeignKey("CircleId")]
|
||||
public virtual Circle Circle { get; set; }
|
||||
|
||||
[YaRequired]
|
||||
public string MemberId { get; set; }
|
||||
|
||||
[ForeignKey("MemberId")]
|
||||
public virtual ApplicationUser Member { get; set; }
|
||||
}
|
||||
}
|
||||
31
src/Yavsc.Server/Models/Relationship/Contact.cs
Normal file
31
src/Yavsc.Server/Models/Relationship/Contact.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public class Contact: IContact
|
||||
{
|
||||
[Required()]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[Required()]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string EMail { get; set; }
|
||||
|
||||
public long AddressId { get ; set; }
|
||||
|
||||
[ForeignKey("AddressId")]
|
||||
public virtual PostalAddress PostalAddress { get; set; }
|
||||
|
||||
|
||||
[ForeignKey("OwnerId"),NotMapped]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[ForeignKey("UserId"),NotMapped]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
}
|
||||
}
|
||||
28
src/Yavsc.Server/Models/Relationship/HyperLink.cs
Normal file
28
src/Yavsc.Server/Models/Relationship/HyperLink.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public partial class HyperLink
|
||||
{
|
||||
[YaStringLength(5,1024)]
|
||||
[Display(Name="HRefDisplayName", ResourceType=typeof(HyperLink),
|
||||
Prompt="http://some.web.site")]
|
||||
public string HRef { get; set; }
|
||||
|
||||
[YaStringLength(0,12)]
|
||||
[Display(Name="MethodDisplayName", ResourceType=typeof(HyperLink), Prompt="GET")]
|
||||
public string Method { get; set; }
|
||||
|
||||
[YaStringLength(0,25)]
|
||||
[Display(Name="RelDisplayName", ResourceType=typeof(HyperLink),
|
||||
Prompt="href")]
|
||||
public string Rel { get; set; }
|
||||
|
||||
[YaStringLength(3,50)]
|
||||
[Display(Name="ContentTypeDisplayName", ResourceType=typeof(HyperLink),
|
||||
Prompt="text/html")]
|
||||
public string ContentType { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
11
src/Yavsc.Server/Models/Relationship/LocationKind.cs
Normal file
11
src/Yavsc.Server/Models/Relationship/LocationKind.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public enum LocationKind
|
||||
{
|
||||
|
||||
PostalAddress,
|
||||
LocationName,
|
||||
City
|
||||
|
||||
}
|
||||
}
|
||||
21
src/Yavsc.Server/Models/Relationship/PostalAddress.cs
Normal file
21
src/Yavsc.Server/Models/Relationship/PostalAddress.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
/// <summary>
|
||||
/// Well defined postal adress
|
||||
/// </summary>
|
||||
public class PostalAddress
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public string Street1 { get; set; }
|
||||
public string Street2 { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string Province { get; set; }
|
||||
public string Country { get; set; }
|
||||
}
|
||||
}
|
||||
10
src/Yavsc.Server/Models/Relationship/Relation.cs
Normal file
10
src/Yavsc.Server/Models/Relationship/Relation.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public class Relation<TDescription>
|
||||
{
|
||||
public RelationKind Kind { get; set; }
|
||||
|
||||
TDescription Description { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
19
src/Yavsc.Server/Models/Relationship/ReletionKind.cs
Normal file
19
src/Yavsc.Server/Models/Relationship/ReletionKind.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public enum RelationKind
|
||||
{
|
||||
Css,
|
||||
Favicon,
|
||||
WebPage,
|
||||
Video,
|
||||
Image,
|
||||
Audio,
|
||||
EmailAddress,
|
||||
Position,
|
||||
PostalAddress,
|
||||
Work,
|
||||
Business,
|
||||
Friend,
|
||||
Family
|
||||
}
|
||||
}
|
||||
12
src/Yavsc.Server/Models/Relationship/StaticContact.cs
Normal file
12
src/Yavsc.Server/Models/Relationship/StaticContact.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public class StaticContact
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string EMail { get; set; }
|
||||
public PostalAddress? PostalAddress { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
15
src/Yavsc.Server/Models/Relationship/Tag.cs
Normal file
15
src/Yavsc.Server/Models/Relationship/Tag.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public class Tag
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[YaRequired()]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue