Hi, Can anyone here help me to migrate this from AutoFac to Windsor please?
private async Task ProcessEvent(string eventName, string message)
{
if (_subsManager.HasSubscriptionsForEvent(eventName))
{
using (var scope = _autofac.BeginLifetimeScope(AUTOFAC_SCOPE_NAME)) \\\ How can you do tag the scope in Windsor?
{
var subscriptions = _subsManager.GetHandlersForEvent(eventName);
foreach (var subscription in subscriptions)
{
if (subscription.IsDynamic)
{
var handler = scope.ResolveOptional(subscription.HandlerType) as IDynamicIntegrationEventHandler;
dynamic eventData = JObject.Parse(message);
await handler.Handle(eventData);
}
else
{
var eventType = _subsManager.GetEventTypeByName(eventName);
var integrationEvent = JsonConvert.DeserializeObject(message, eventType);
var handler = scope.ResolveOptional(subscription.HandlerType);
var concreteType = typeof(IIntegrationEventHandler<>).MakeGenericType(eventType);
await (Task)concreteType.GetMethod("Handle").Invoke(handler, new object[] { integrationEvent });
}
}
}
}
}
I had this problem too. It's happen when we make changes to our properties (remove/add).
Hi, I just started playing around Core + Angular template.
In PhoneBook sample you aren't used Prime DataTable. I want try to add people phone's in CreateOrEditPeople modal as PrimeNG DataTable in new tab with filtering/sorting and action column.
If we have
public ICollection<PhoneDto> Phones { get; set; }
property in GetPeopleForEdit class's, How you can import Data as PrimeNG DataTable in modal from that model?
Even a brief guide gives me a lot of help Thank you very much
This made me study more and check UserFriendsCache. I noticed that the UserFriendsCache is a domain service and should coding like a CRUD domain service. A line in the ABP docs made me wrong. The guide says That's it. Our person cache is ready to use!. Because of this, I thought I could use CountryCache like a repository in my AppServices!
Since my English is weak, this mistake is not understood. Thanks again to the Master @Alper
<cite>alper: </cite> You are learning very fast @csbeginner ;)
Thank you Sir :D :D :D :D Posts in this forum and their reply are like a free university for beginners like me ;) ;) :geek:
If you are working on ASP.NET Core & Angular template, after generating the entity via Power Tools, run your *.Web.Host project and then run "./angular/nswag/refresh.bat" to update service-proxies.ts.
[AutoMapFrom(typeof(Country))]
public class CountryCacheItem
{
public long Id { get; set; }
public string Name { get; set; }
public string TwoLetterIsoCode { get; set; }
public string ThreeLetterIsoCode { get; set; }
public int NumericIsoCode { get; set; }
public bool AllowBilling { get; set; }
public bool AllowShipping { get; set; }
public bool Published { get; set; }
public int DisplayOrder { get; set; }
public ICollection<StateOrProvince> StateOrProvinces { get; set; }
}
public interface ICountryCache : IEntityCache<CountryCacheItem, long>
{
}
public class CountryCache
: EntityCache<Country, CountryCacheItem, long>,
ICountryCache,
ISingletonDependency
{
public CountryCache(ICacheManager cacheManager,
IRepository<Country, long> repository): base(cacheManager, repository)
{
}
}
What's my next step to get list of countries without query to database
Can not guide me? I'm waiting for two days here :cry: :cry: :cry: :cry: :cry:
OR You can add new string array property to your entity
string[] RequiredPermissions {get; set;}
Usage:
@if (IsGranted(AppPermissions.Pages_SomePermission))
{
@foreach (var object in Model.YourObject.Where(e => e.RequiredPermissions.Contains("yourSomePermission")))
{
@Html.Partial("_ObjectPartialView", object)
}
}
@foreach (var object in Model.YourObject.Where(e => e.RequiredPermissions.Contains("yourOtherRequiredPermission")))
{
@Html.Partial("_ObjectPartialView", object)
}
Hi,
I think isn't possible for dynamical items. If you have static items list then you can use hard codes in your razor
<select class="form-control" name="IsApprovedFilter" id="IsApprovedFilterId">
@if (IsGranted(Pages_Blogs_Comments))
{
<option value="-1">@L("All")</option>
<option value="1">@L("True")</option>
}
<option value="0">@L("False")</option>
</select>