Base solution for your next web application

Activities of "hitaspdotnet"

<cite>ismcagdas: </cite>

  1. Which entity you want to add non-nullable OrganizationUnitId ?
  2. How would oyu like to associate this entity with an OU ? Do you want users to select it on the UI ? Or do you want to associate it with the currently logged in user's OU ?

Hi,

  1. All entities each of which has SpaceId property (OR Space's contents).

  2. Since each user may be a member of multi spaces, so it must be selected in the UI

I just need an 'Create/Update entity in OU' example so I can understand the ABP OU feature.

For example: We have a root OU named as 'MyRootOu' with code '00001' 'MyRootOu' has child named as 'MyRootOuChild' with code '00001.00001'

Now, we have a entity named as 'Blog' with not-nullable Ou Id, When a user wants to create a new Blog in 'MyRootOuChild' , what we need and how it possible in the 'BlogAppService'?

  1. Is the Ou ID sufficient?
  2. Given the example above, where is the best use of 'myRootOuChild.Code'? // I can't understand the CODE section of a OU

Thanks in advance @ismcagdas

<cite>ismcagdas: </cite> @csbeginner ABP has defined

<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Zero.Common/Organizations/IMayHaveOrganizationUnit.cs">https://github.com/aspnetboilerplate/as ... ionUnit.cs</a> and <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Zero.Common/Organizations/IMustHaveOrganizationUnit.cs">https://github.com/aspnetboilerplate/as ... ionUnit.cs</a>

interfaces to standardize the usage or OrganizationUnitId but those interfaces are not used in dynamic filtering.

So, you can derive your entities from one of those interfaces and implement an OrganizationUnit filter similar to IMayHaveTenant or IMustHaveTenant.

Thanks for reply. My question is 'How to have CRUD entity service for an entity with not-nullable organization unit, when that entity's organization unit had child/parents?'

I can't understand the OU.Code section, How Abp mapping tree of OU at CURD request? We should pass OU.Code or OU.Id from our controllers in write scenarios?

Hi, I want try to use OU in my project I can't understand ABP original documents. In ABP docs author just focused on getting entities in OUs. So how the entity sets in OU/ChildOU?

In my case, I have a root OU named 'Spaces' and that contains grouped users for example 'Management Team', 'Customer Relation', 'Developers' , etc. The spaces has child spaces for example 'Management Team contains Owners|Moderators' In last, I have entities that should belongs to an Space/ChildSpace and that entities must be available just for Space/ChildSpace users. For example 'Blogs', 'News', 'Files', etc.

I have try this case before reading Abp OU docs by:

  1. Creating Space class
public class Space : FullAuditedEntity, 
        IMustHaveTenant,
        IMultiLingualEntity<SpaceTranslation>
    {
        private ICollection<UserGroup> _userGroups;

        public int TenantId { get; set; }

        public int? ParentId { get; set; }

        public virtual string CompanyName { get; set; }
  
        public virtual string CompanyAddress { get; set; }

        public virtual string CompanyPhoneNumber { get; set; }

        public virtual bool IsPrivate { get; set; }

        public virtual long OwnerId { get; set; }

        public virtual ICollection<UserGroup> UserGroups
        {
            get => _userGroups ?? (_userGroups= new List<UserGroup>());
            protected set => _userGroups= value;
        }

        public ICollection<SpaceTranslation> Translations { get; set; }
    }
  1. Creating Space Contents (Blogs as sample)
public class BlogPost : CreationAuditedEntity,
        IMustHaveTenant, 
        IMultiLingualEntity<BlogPostTranslation>
    {
        private ICollection<BlogComment> _blogComments;

        public int TenantId { get; set; }

        public virtual bool AllowComments { get; set; }

        public virtual string Tags { get; set; }

        public virtual DateTime? StartDateUtc { get; set; }

        public virtual DateTime? EndDateUtc { get; set; }

        public virtual string MetaKeywords { get; set; }

        public virtual string MetaDescription { get; set; }

        public virtual string MetaTitle { get; set; }

        public virtual int SpaceId { get; set; }

        public virtual ICollection<BlogComment> BlogComments
        {
            get => _blogComments ?? (_blogComments = new List<BlogComment>());
            protected set => _blogComments = value;
        }

        public virtual ICollection<BlogPostTranslation> Translations { get; set; }

I think it's can be easier using ABP OU feature, How can you doing this by using Abp OrganizationUnit? Please if possible help me with sample code. Thanks in advance :? :(

I asked this because I'm use version controller for keeping my project up to date (replacing new release with the previous non-edit project in different branch and merging them to our Dev branch). Release versions has to many changes and that makes hard work, so I always doing this on my project after 4-5 commits

Thanks for fast reply! I think you didn't read my post fully. I know what they are. 3-4 days ago Dev branch had same size with 5.5, I do not see the file added to the project repository with a size of +50MB. You can check commits histories by going to ASP.NET ZERO's github account then checking the Core repository

Hi, What's different on system files between '5.5' version and 'Dev Branch' version in download page? ~48 MB for 5.5 version ~91 MB Dev Branch version

Before this they had same volumes 44~48 MB

How can you running a task at startup time when your task comes from a plugin? I have a plugin with special tasks and I want complete them before application module initializing but from a plugin in release mode. If I marking my task classes with an interface like IStartupTask then how can I completing tasks with this marker at startup time after *.Core module before *.Application module. I think it's can be done with a class registrar in PreInitialize method of Application module but i don't know how to do :(

Thank you for helpful replies. I got the solution

<cite>ismcagdas: </cite> @csbeginner you can't because it is registered to DI in the initialize method. So, why don't you do it in initialize or post initialize ?

Hi @ismcagdas Thanks for reply

My plugin has EF module in separate class library (made by ABP template without module zero) I thought resolving DbContext in PreInitialize is possible when our current module is on top. So, which method is best for this workflow and what's the safe way for resolving the context for applying migration?

Thanks again

Dear support team Hi, I want run the EF runtime migration method by using MyPluginDbContext.Database.Migrate() command in PreInitialize method of MyPluginMvcWebModule if that migrate isn't applied before. But I can't resolve required services for that. I'm trying to resolve DbContext with DbContextProvider and IocManager.Resolve<IHttpContextAccessor>().HttpContext.RequestServices.GetRequiredService<CMSDbContext>(); Can you guide me please to resolve DbContext services in modules configuration? It's can be helpful for plugins with DbMigration.

Thanks. Best regards.

Showing 11 to 20 of 65 entries