So I installed package: Microsoft.AspNet.WebApi.Cors to the web project and followed instructions found here:
<a class="postlink" href="http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api">http://www.asp.net/web-api/overview/sec ... in-web-api</a>
However, I am still being blocked. I think because of automated api config through aspnetzero framework that the cors set up is being superceded by something else. Any idea how to get this working? Thanks. This is what my service method looks like:
[EnableCors(origins: "http://site.com", headers: "*", methods: "*")]
public async Task<List<Project.Sub.Marketing.Webinar>> GetWebinars()
{
var webinars = await _webinarRepository.GetAllListAsync();
return webinars.Where(a => a.InSession == false && a.WebinarAccount == "x" && a.StartTime >= today).OrderBy(a => a.StartTime).ToList();
}
To clarify, I have multi tenancy set up, and would like visibility in the user list to all users on the system, not just for the host tenant from that login.
So when logging into host the only visible user is myself.
I'd like to return a list of all users on the site. But UserManager object appears to be bound to AbpSession. Is there a way to query the User list directly?
I'd like that to show in my host account in case i wind up with password problems on a tenant account that i can do the reset for.
thank you as always for the fantastic support.
Upon further inspection I do see that the tenant settings table has these values:
Abp.Net.Mail.DefaultFromAddress Abp.Net.Mail.DefaultFromDisplayName
However, defaultfromdisplayname seems to be ignored.
So is there away I can manually set both those settings?
So, for some reason when the app sends mails for me there is no display name ( i dont recall if i set one or not).
Also, the box i'm sending from is an exchange email so it supports aliasing, i'd like to swap out the display name and display address when sending mail for certain system messaging. however when i try this:
emailMsg.From.DisplayName = "Site Support Center";
emailMsg.From.Address = "[email protected]";
Both of those are ready only properties. So, my mail box name is "help" so the display name on the emails that comes in just "help" instead of "My Site Help Center" or whatever.
So ... a.) Is it possible to set the default display name for the smtp account for the site. b.) how in one off instances do i manually set it?
Thanks! Also have you figured out an upgrade price? I have another project coming my way I'd like to use the starter kit again for. Zach
I made a simple mailer like so: public class AppMailerService : DownPaymentAppServiceBase, IAppMailerService { private readonly IEmailSender _emailSender; private readonly ISmtpEmailSenderConfiguration _smtpConfig;
public AppMailerService(ISmtpEmailSenderConfiguration smtpConfig, IEmailSender emailSender)
{
_smtpConfig = smtpConfig;
_emailSender = emailSender;
}
public async Task SendSimpleMessageAsync(MailerInputDto input)
{
var smtpClient = new SmtpEmailSender(_smtpConfig).BuildClient();
var from = new MailAddress(_smtpConfig.UserName);
var msg = new MailMessage(from, new MailAddress(input.ToAddresses))
{
Subject = input.Subject,
Body = input.Message,
IsBodyHtml = true,
};
if (input.CCAddress != null)
{
msg.CC.Add(new MailAddress(input.CCAddress));
}
if (input.BCCAddress != null)
{
msg.Bcc.Add(new MailAddress(input.BCCAddress));
}
await _emailSender.SendAsync(msg, true);
// smtpClient.Send(msg);
}
}
I've noticed the await SendAsync seems to take a long time... 15 seconds-ish... is there a wait to skip the await method here? I don't care about server response since everything is being logged to database.
Thanks!
well i figured it out.
var city = _geoRepository.Query<Geo>(a => a.Where(aa=> aa.Zip == input.Zip).FirstOrDefault());
cant use getall.
However, I did have my ActionResult annotated with [UnitOfWork]... why didnt that work? How do I ensure that db connection is open when coming into the repo?
So I tried this, but the action inside the service is error that DbContext has already been disposed.
private NAEA.DownPayment.Programs.IGeoAppService _geoService; public HomeController( IRepository<Geo> geoRepository) { _geoService = new GeoAppService(geoRepository); }
public ActionResult Index()
{
_geoService.GetCityFromZip(new GetGeoInput { Zip = "85210" });
return View();
}
So I've added a geo service that has some handy geo lookup utils in it. What I'm trying to do from the home controller on a form submit to do the following.
MyApp.Programs.IGeoAppService ga = new Programs.GeoAppService(new IRepository<Programs.Geo>());
ga.GetCityFromZip(new GetGeoInput { Zip = "85210" });
but obviously new IRepository<Programs.Geo>()) is not allowed. Can you tell me how to properly access the service from a MVC controller?
Also, it would be handy if there was a way that abp could allow some publicly exposed services before the angular stuff comes in. is there some sort of config to do that?