-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1648044
commit 9519a26
Showing
778 changed files
with
19,954 additions
and
32,727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
23 changes: 11 additions & 12 deletions
23
examples/RapidCMS.Example.Github/Attributes/BioValidationAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace RapidCMS.Example.Github.Attributes | ||
namespace RapidCMS.Example.Github.Attributes; | ||
|
||
internal class BioValidationAttribute : ValidationAttribute | ||
{ | ||
internal class BioValidationAttribute : ValidationAttribute | ||
{ | ||
public override bool RequiresValidationContext => true; | ||
public override bool RequiresValidationContext => true; | ||
|
||
protected override ValidationResult IsValid(object? value, ValidationContext validationContext) | ||
protected override ValidationResult IsValid(object? value, ValidationContext validationContext) | ||
{ | ||
if (value is string bio) | ||
{ | ||
if (value is string bio) | ||
if (bio.Contains("fdsa")) | ||
{ | ||
if (bio.Contains("fdsa")) | ||
{ | ||
return new ValidationResult("Bio's cannot contain 'fdsa'.", validationContext.MemberName == null ? null : new[] { validationContext.MemberName }); | ||
} | ||
return new ValidationResult("Bio's cannot contain 'fdsa'.", validationContext.MemberName == null ? null : new[] { validationContext.MemberName }); | ||
} | ||
|
||
return ValidationResult.Success!; | ||
} | ||
|
||
return ValidationResult.Success!; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
using System; | ||
using RapidCMS.Core.Abstractions.Data; | ||
|
||
namespace RapidCMS.Example.Github.Entities | ||
namespace RapidCMS.Example.Github.Entities; | ||
|
||
internal class Country : IEntity, ICloneable | ||
{ | ||
internal class Country : IEntity, ICloneable | ||
{ | ||
public string? Id { get; set; } | ||
public string? Name { get; set; } | ||
public string? Id { get; set; } | ||
public string? Name { get; set; } | ||
|
||
public object Clone() | ||
public object Clone() | ||
{ | ||
return new Country | ||
{ | ||
return new Country | ||
{ | ||
Id = Id, | ||
Name = Name | ||
}; | ||
} | ||
Id = Id, | ||
Name = Name | ||
}; | ||
} | ||
} |
39 changes: 19 additions & 20 deletions
39
examples/RapidCMS.Example.Github/Entities/CountryPerson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
using System; | ||
using RapidCMS.Core.Abstractions.Data; | ||
|
||
namespace RapidCMS.Example.Github.Entities | ||
namespace RapidCMS.Example.Github.Entities; | ||
|
||
internal class CountryPerson : IEntity, ICloneable | ||
{ | ||
internal class CountryPerson : IEntity, ICloneable | ||
{ | ||
public string? Id { get; set; } | ||
public string? Name { get; set; } | ||
public string? Email { get; set; } | ||
public string? Bio { get; set; } | ||
public string? Id { get; set; } | ||
public string? Name { get; set; } | ||
public string? Email { get; set; } | ||
public string? Bio { get; set; } | ||
|
||
public string? FavouriteCountryId1 { get; set; } | ||
public string? FavouriteCountryId2 { get; set; } | ||
public string? FavouriteCountryId1 { get; set; } | ||
public string? FavouriteCountryId2 { get; set; } | ||
|
||
public object Clone() | ||
public object Clone() | ||
{ | ||
return new CountryPerson | ||
{ | ||
return new CountryPerson | ||
{ | ||
Bio = Bio, | ||
Email = Email, | ||
Id = Id, | ||
Name = Name, | ||
FavouriteCountryId1 = FavouriteCountryId1, | ||
FavouriteCountryId2 = FavouriteCountryId2 | ||
}; | ||
} | ||
Bio = Bio, | ||
Email = Email, | ||
Id = Id, | ||
Name = Name, | ||
FavouriteCountryId1 = FavouriteCountryId1, | ||
FavouriteCountryId2 = FavouriteCountryId2 | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
using System; | ||
using RapidCMS.Core.Abstractions.Data; | ||
|
||
namespace RapidCMS.Example.Github.Entities | ||
namespace RapidCMS.Example.Github.Entities; | ||
|
||
internal class Person : IEntity, ICloneable | ||
{ | ||
internal class Person : IEntity, ICloneable | ||
{ | ||
public string? Id { get; set; } | ||
public string? Name { get; set; } | ||
public string? Email { get; set; } | ||
public string? Bio { get; set; } | ||
public string? Id { get; set; } | ||
public string? Name { get; set; } | ||
public string? Email { get; set; } | ||
public string? Bio { get; set; } | ||
|
||
public object Clone() | ||
public object Clone() | ||
{ | ||
return new Person | ||
{ | ||
return new Person | ||
{ | ||
Bio = Bio, | ||
Email = Email, | ||
Id = Id, | ||
Name = Name | ||
}; | ||
} | ||
Bio = Bio, | ||
Email = Email, | ||
Id = Id, | ||
Name = Name | ||
}; | ||
} | ||
} |
Oops, something went wrong.