Using YaStringLength and YaRequired
This commit is contained in:
parent
7d9495e326
commit
9457ba71d1
62 changed files with 396 additions and 150 deletions
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
|
|
@ -13,10 +14,10 @@ namespace Yavsc.Models.Relationship
|
|||
|
||||
public bool Public { get; set; }
|
||||
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId"),JsonIgnore,NotMapped]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
|
|
@ -8,13 +9,13 @@ namespace Yavsc.Models.Relationship
|
|||
public partial class CircleMember
|
||||
{
|
||||
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public long CircleId { get; set; }
|
||||
|
||||
[ForeignKey("CircleId")]
|
||||
public virtual Circle Circle { get; set; }
|
||||
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string MemberId { get; set; }
|
||||
|
||||
[ForeignKey("MemberId")]
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
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()]
|
||||
[YaRequired()]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[Required()]
|
||||
[YaRequired()]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
|
|
@ -12,7 +13,7 @@ namespace Yavsc.Models.Relationship
|
|||
/// <summary>
|
||||
/// The longitude.
|
||||
/// </summary>
|
||||
[Required(),Display(Name="Longitude")]
|
||||
[YaRequired(),Display(Name="Longitude")]
|
||||
[Range(-180, 360.0)]
|
||||
|
||||
public double Longitude { get; set; }
|
||||
|
|
@ -21,7 +22,7 @@ namespace Yavsc.Models.Relationship
|
|||
///
|
||||
/// The latitude.
|
||||
/// </summary>
|
||||
[Required(),Display(Name="Latitude")]
|
||||
[YaRequired(),Display(Name="Latitude")]
|
||||
[Range(-90, 90 )]
|
||||
public double Latitude { get; set; }
|
||||
|
||||
|
|
@ -30,7 +31,7 @@ namespace Yavsc.Models.Relationship
|
|||
public class Location : Position, ILocation {
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[Required(),
|
||||
[YaRequired(),
|
||||
Display(Name="Address"),
|
||||
MaxLength(512)]
|
||||
public string Address { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
|
|
@ -8,7 +9,7 @@ namespace Yavsc.Models.Relationship
|
|||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[Required()]
|
||||
[YaRequired()]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue