Using YaStringLength and YaRequired

This commit is contained in:
Paul Schneider 2019-09-04 01:25:36 +01:00
commit 9457ba71d1
62 changed files with 396 additions and 150 deletions

View file

@ -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; }