diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs index 029ee5cd3c..40ebca015e 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs @@ -5,7 +5,6 @@ using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Entities; using Volo.Abp.DynamicProxy; -using Volo.Abp.Threading; namespace Volo.Abp.Domain.Repositories { @@ -27,17 +26,6 @@ namespace Volo.Abp.Domain.Repositories } } - public static void EnsureCollectionLoaded( - this IBasicRepository repository, - TEntity entity, - Expression>> propertyExpression - ) - where TEntity : class, IEntity - where TProperty : class - { - AsyncHelper.RunSync(() => repository.EnsureCollectionLoadedAsync(entity, propertyExpression)); - } - public static async Task EnsurePropertyLoadedAsync( this IBasicRepository repository, TEntity entity, @@ -53,16 +41,5 @@ namespace Volo.Abp.Domain.Repositories await repo.EnsurePropertyLoadedAsync(entity, propertyExpression, cancellationToken); } } - - public static void EnsurePropertyLoaded( - this IBasicRepository repository, - TEntity entity, - Expression> propertyExpression - ) - where TEntity : class, IEntity - where TProperty : class - { - AsyncHelper.RunSync(() => repository.EnsurePropertyLoadedAsync(entity, propertyExpression)); - } } } diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs index 6aca2403cc..f471fecaa1 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/BackgroundEmailSendingJob.cs @@ -1,5 +1,6 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; +using Volo.Abp.Threading; namespace Volo.Abp.Emailing { @@ -14,7 +15,7 @@ namespace Volo.Abp.Emailing public override void Execute(BackgroundEmailSendingJobArgs args) { - EmailSender.Send(args.To, args.Subject, args.Body, args.IsBodyHtml); + AsyncHelper.RunSync(() => EmailSender.SendAsync(args.To, args.Subject, args.Body, args.IsBodyHtml)); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs index 8ae737043b..a3b085a27c 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderBase.cs @@ -3,7 +3,6 @@ using System.Net.Mail; using System.Text; using System.Threading.Tasks; using Volo.Abp.BackgroundJobs; -using Volo.Abp.Threading; namespace Volo.Abp.Emailing { @@ -36,27 +35,11 @@ namespace Volo.Abp.Emailing }); } - public virtual void Send(string to, string subject, string body, bool isBodyHtml = true) - { - Send(new MailMessage - { - To = { to }, - Subject = subject, - Body = body, - IsBodyHtml = isBodyHtml - }); - } - public virtual async Task SendAsync(string from, string to, string subject, string body, bool isBodyHtml = true) { await SendAsync(new MailMessage(from, to, subject, body) { IsBodyHtml = isBodyHtml }); } - public virtual void Send(string from, string to, string subject, string body, bool isBodyHtml = true) - { - Send(new MailMessage(from, to, subject, body) { IsBodyHtml = isBodyHtml }); - } - public virtual async Task SendAsync(MailMessage mail, bool normalize = true) { if (normalize) @@ -86,16 +69,6 @@ namespace Volo.Abp.Emailing ); } - public virtual void Send(MailMessage mail, bool normalize = true) - { - if (normalize) - { - AsyncHelper.RunSync(() => NormalizeMailAsync(mail)); - } - - SendEmail(mail); - } - /// /// Should implement this method to send email in derived classes. /// diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/IEmailSender.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/IEmailSender.cs index 999469ce0c..612d8f078c 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/IEmailSender.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/IEmailSender.cs @@ -13,31 +13,11 @@ namespace Volo.Abp.Emailing /// Task SendAsync(string to, string subject, string body, bool isBodyHtml = true); - /// - /// Sends an email. - /// - void Send(string to, string subject, string body, bool isBodyHtml = true); - /// /// Sends an email. /// Task SendAsync(string from, string to, string subject, string body, bool isBodyHtml = true); - /// - /// Sends an email. - /// - void Send(string from, string to, string subject, string body, bool isBodyHtml = true); - - /// - /// Sends an email. - /// - /// Mail to be sent - /// - /// Should normalize email? - /// If true, it sets sender address/name if it's not set before and makes mail encoding UTF-8. - /// - void Send(MailMessage mail, bool normalize = true); - /// /// Sends an email. ///