mirror of https://github.com/abpframework/abp.git
23 changed files with 229 additions and 77 deletions
@ -0,0 +1,39 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.MongoDB |
|||
{ |
|||
public class AbpMongoDbContextOptions |
|||
{ |
|||
internal Dictionary<Type, Type> DbContextReplacements { get; } |
|||
|
|||
public AbpMongoDbContextOptions() |
|||
{ |
|||
DbContextReplacements = new Dictionary<Type, Type>(); |
|||
} |
|||
|
|||
internal Type GetReplacedTypeOrSelf(Type dbContextType) |
|||
{ |
|||
var replacementType = dbContextType; |
|||
while (true) |
|||
{ |
|||
if (DbContextReplacements.TryGetValue(replacementType, out var foundType)) |
|||
{ |
|||
if (foundType == dbContextType) |
|||
{ |
|||
throw new AbpException( |
|||
"Circular DbContext replacement found for " + |
|||
dbContextType.AssemblyQualifiedName |
|||
); |
|||
} |
|||
|
|||
replacementType = foundType; |
|||
} |
|||
else |
|||
{ |
|||
return replacementType; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Validation; |
|||
using Volo.CmsKit.Blogs; |
|||
|
|||
namespace Volo.CmsKit.Admin.Blogs |
|||
{ |
|||
public class UpdateBlogPostDto |
|||
{ |
|||
[Required] |
|||
[DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxTitleLength))] |
|||
public string Title { get; set; } |
|||
|
|||
[Required] |
|||
[DynamicStringLength( |
|||
typeof(BlogPostConsts), |
|||
nameof(BlogPostConsts.MaxSlugLength), |
|||
nameof(BlogPostConsts.MinSlugLength))] |
|||
public string Slug { get; set; } |
|||
|
|||
[DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxShortDescriptionLength))] |
|||
public string ShortDescription { get; set; } |
|||
|
|||
} |
|||
} |
|||
Loading…
Reference in new issue