How I can send to you my logs
YEs useing EF , are there another way
my Database is SQL server but I need to connect to another Database(Oracle) to call some SP
<a class="postlink" href="http://localhost/BarznWeb.BarznWeb.Web.Mvc/swagger/">http://localhost/BarznWeb.BarznWeb.Web.Mvc/swagger/</a>
or
<a class="postlink" href="http://localhost/BarznWeb.BarznWeb.Web.Mvc/swagger/v1/swagger.json">http://localhost/BarznWeb.BarznWeb.Web. ... agger.json</a>
But when run the VS on debug mode and call the web browser using the following link <a class="postlink" href="http://localhost:62114/swagger/">http://localhost:62114/swagger/</a> the swagger is working fine
Can you please support me with sample of code working on the ASPZero version 3.5
<cite>aaron: </cite> Tip: Wrap your code in the following for formatting and readability:
[code]
[/code:39lrdbwm] A shortcut is to highlight your code and click on the </> button in the formatting toolbar.
I did that wrap my code in <code> tage can tell me what the next step to apply the filter on the all query
Sorry I set the below implementation 1)
public interface IHasCustomer
{
string InsCustID { get; set; }
}
protected override bool ShouldFilterEntity<TEntity>(IMutableEntityType entityType)
{
return base.ShouldFilterEntity<TEntity>(entityType);
}
protected override Expression<Func<TEntity, bool>> CreateFilterExpression<TEntity>()
{
Expression<Func<TEntity, bool>> expression = null;
if (typeof(IHasCustomer).IsAssignableFrom(typeof(TEntity)))
{
Expression<Func<TEntity, bool>> mustHaveTenantFilter = e => ((IHasCustomer)e).InsCustID == GetCurrentCustomerIdOrNull() || (((IHasCustomer)e).InsCustID == GetCurrentCustomerIdOrNull()) == true;
expression = expression == null ? mustHaveTenantFilter : CombineExpressions(expression, mustHaveTenantFilter);
}
return base.CreateFilterExpression<TEntity>();
}
my question what the next to run and apply the filter
I have aspzero, can you please provide us with example to set custom filler ?
OK, Thanks for your support.
How I can attach file to the email? does Frame Work support the attachment file when send the email ??
Dear
I commit the ReplaceService for IEmailSenderConfiguration but the password sent intercepted, so
I back the code as below but in same time I have error
MailKit.Security.AuthenticationException: 'AuthenticationInvalidCredentials: 5.7.3 Authentication unsuccessful'
public class DefaultMailKitSmtpBuilder : IMailKitSmtpBuilder, ITransientDependency { private readonly ISmtpEmailSenderConfiguration _smtpEmailSenderConfiguration; //private readonly IAbpMailKitConfiguration _abpMailKitConfiguration;
public DefaultMailKitSmtpBuilder(ISmtpEmailSenderConfiguration smtpEmailSenderConfiguration)
{
_smtpEmailSenderConfiguration = smtpEmailSenderConfiguration;
}
public virtual SmtpClient Build()
{
var client = new SmtpClient();
try
{
ConfigureClient(client);
return client;
}
catch
{
client.Dispose();
throw;
}
}
protected virtual void ConfigureClient(SmtpClient client)
{
client.Connect(
_smtpEmailSenderConfiguration.Host,
_smtpEmailSenderConfiguration.Port,SecureSocketOptions.None
);
if (_smtpEmailSenderConfiguration.UseDefaultCredentials)
{
return;
}
client.Authenticate(
_smtpEmailSenderConfiguration.UserName,
_smtpEmailSenderConfiguration.Password
);
}
protected virtual SecureSocketOptions GetSecureSocketOption()
{
return _smtpEmailSenderConfiguration.EnableSsl
? SecureSocketOptions.SslOnConnect
: SecureSocketOptions.StartTlsWhenAvailable;
}
}
[DependsOn(
typeof(AbpZeroCoreModule),
typeof(AbpZeroLdapModule),
typeof(AbpAutoMapperModule),
typeof(AbpAspNetZeroCoreModule),
typeof(AbpMailKitModule))]
public class BarznWebCoreModule : AbpModule
{
public override void PreInitialize()
{
//workaround for issue: <a class="postlink" href="https://github.com/aspnet/EntityFrameworkCore/issues/9825">https://github.com/aspnet/EntityFramewo ... ssues/9825</a>
//related github issue: <a class="postlink" href="https://github.com/aspnet/EntityFrameworkCore/issues/10407">https://github.com/aspnet/EntityFramewo ... sues/10407</a>
AppContext.SetSwitch("Microsoft.EntityFrameworkCore.Issue9825", true);
Configuration.Auditing.IsEnabledForAnonymousUsers = true;
//Declare entity types
Configuration.Modules.Zero().EntityTypes.Tenant = typeof(Tenant);
Configuration.Modules.Zero().EntityTypes.Role = typeof(Role);
Configuration.Modules.Zero().EntityTypes.User = typeof(User);
BarznWebLocalizationConfigurer.Configure(Configuration.Localization);
//Adding feature providers
Configuration.Features.Providers.Add<AppFeatureProvider>();
//Adding setting providers
Configuration.Settings.Providers.Add<AppSettingProvider>();
//Adding notification providers
Configuration.Notifications.Providers.Add<AppNotificationProvider>();
//Enable this line to create a multi-tenant application.
Configuration.MultiTenancy.IsEnabled = BarznWebConsts.MultiTenancyEnabled;
//Enable LDAP authentication (It can be enabled only if MultiTenancy is disabled!)
//Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource));
//Configure roles
AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement);
//if (DebugHelper.IsDebug)
//{
// //Disabling email sending in debug mode
// Configuration.ReplaceService<IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient);
//}
//Configuration.ReplaceService(typeof(IEmailSenderConfiguration), () =>
//{
// Configuration.IocManager.IocContainer.Register(
// Component.For<IEmailSenderConfiguration, ISmtpEmailSenderConfiguration>()
// .ImplementedBy<BarznWebSmtpEmailSenderConfiguration>()
// .LifestyleTransient()
// );
//});
Configuration.ReplaceService(typeof(IEmailSenderConfiguration), () =>
{
Configuration.IocManager.IocContainer.Register(
Component.For<IEmailSenderConfiguration, ISmtpEmailSenderConfiguration>()
.ImplementedBy<BarznWebSmtpEmailSenderConfiguration>()
.LifestyleTransient()
);
});
Configuration.ReplaceService<IMailKitSmtpBuilder, DefaultMailKitSmtpBuilder>(DependencyLifeStyle.Transient);
Configuration.Caching.Configure(FriendCacheItem.CacheName, cache =>
{
cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(30);
});
Configuration.Caching.Configure(PaymentCacheItem.CacheName, cache =>
{
cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(BarznWebConsts.PaymentCacheDurationInMinutes);
});
}
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(typeof(BarznWebCoreModule).GetAssembly());
}
public override void PostInitialize()
{
IocManager.RegisterIfNot<IChatCommunicator, NullChatCommunicator>();
IocManager.Resolve<ChatUserStateWatcher>().Initialize();
IocManager.Resolve<AppTimes>().StartupTime = Clock.Now;
}
}
}
public class BarznWebSmtpEmailSenderConfiguration : SmtpEmailSenderConfiguration { public BarznWebSmtpEmailSenderConfiguration(ISettingManager settingManager) : base(settingManager) {
}
public override string Password => SimpleStringCipher.Instance.Decrypt(GetNotEmptySettingValue(EmailSettingNames.Smtp.Password));
}