eto's and mapping updated

pull/3240/head
Ahmet Çotur 6 years ago
parent 24c61f3edd
commit 5a68a226e1

@ -3,6 +3,7 @@ using JetBrains.Annotations;
namespace Volo.Blogging.Blogs
{
[Serializable]
public class BlogEto
{
public Guid Id { get; set; }

@ -2,6 +2,7 @@
namespace Volo.Blogging.Comments
{
[Serializable]
public class CommentEto
{
public Guid Id { get; set; }

@ -5,6 +5,7 @@ using Volo.Blogging.Tagging;
namespace Volo.Blogging.Posts
{
[Serializable]
public class PostEto
{
public Guid Id { get; set; }
@ -24,7 +25,5 @@ namespace Volo.Blogging.Posts
public string Content { get; set; }
public int ReadCount { get; set; }
public ICollection<TagEto> Tags { get; set; }
}
}

@ -3,6 +3,7 @@ using JetBrains.Annotations;
namespace Volo.Blogging.Tagging
{
[Serializable]
public class TagEto
{
public Guid Id { get; set; }

@ -1,4 +1,5 @@
using Volo.Abp.AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Domain;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Modularity;
@ -11,23 +12,26 @@ namespace Volo.Blogging
{
[DependsOn(
typeof(BloggingDomainSharedModule),
typeof(AbpDddDomainModule))]
typeof(AbpDddDomainModule),
typeof(AbpAutoMapperModule))]
public class BloggingDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<Blog, BlogEto>();
options.EtoMappings.Add<Comment, CommentEto>();
options.EtoMappings.Add<Post, PostEto>();
options.EtoMappings.Add<Tag, TagEto>();
});
context.Services.AddAutoMapperObjectMapper<BloggingDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<BloggingDomainMappingProfile>(validate: true);
});
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<Blog, BlogEto>(typeof(BloggingDomainModule));
options.EtoMappings.Add<Comment, CommentEto>(typeof(BloggingDomainModule));
options.EtoMappings.Add<Post, PostEto>(typeof(BloggingDomainModule));
options.EtoMappings.Add<Tag, TagEto>(typeof(BloggingDomainModule));
});
}
}
}

Loading…
Cancel
Save