Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

I want to create a (Category - Products) page. (Tree ) #2693


User avatar
0
peterlee created

Hi.

I sample the organization (tree) code,

I want to create a (Category - Products) page.

So I did the following.

  1. Create Core - CategoryMaster.cs, CategoryUnit.cs file
  2. Aplication - CategoryUnitAppservies, ICategoryUnitAppservies And DTO
  3. Web - view files ...
  4. DBcontext Added. And Migration

But it was blocked from the first.

CategoryMaster, CategoryUnit "You must declare the body, because it is not marked extern or partial."

The message was confirmed.

Which other file should be declared?


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This problem might be related to your entity definitions. Can you share your entity definitions ?

    Thanks.

  • User Avatar
    0
    peterlee created

    Bold - abstact, extern or partial.... Error

    using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Abp.Domain.Entities; using Abp.Domain.Entities.Auditing;

    namespace PeterNet.SpoManage.ArticleUnit { [Table("PbArticleUnit")] public class ArticleUnit : FullAuditedEntity<long>, IMayHaveTenant { public const int CodeUnitLength = 5; public const int MaxCodeLength = 95; public const int MaxDisplayNameLength = 128;

        public**ArticleUnit**();
    
        public**ArticleUnit**(int? tenantId, string displayName, long? parentId = default(long?));
    
        //
        // 요약:
        //     Children of this OU.
        public virtual ICollection&lt;ArticleUnit&gt; Children { get; set; }
    
        [Required]
        [StringLength(95)]
        public virtual string Code { get; set; }
    
        [Required]
        [StringLength(128)]
        public virtual string DisplayName { get; set; }
        [ForeignKey("ParentId")]
        public virtual ArticleUnit Parent { get; set; }
        public virtual long? ParentId { get; set; }
        public virtual int? TenantId { get; set; }
    
      **public static string AppendCode(string parentCode, string childCode);
        public static string CalculateNextCode(string code);
        public static string CreateCode(params int[] numbers);
        public static string GetLastUnitCode(string code);
        public static string GetParentCode(string code);
        public static string GetRelativeCode(string code, string parentCode);**
    }
    

    }

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks for sharing your entity. I think you need to add body for bold sections in your code. For example this line

    public ArticleUnit();
    

    ,must be

    public ArticleUnit(){
    
    }
    

    Can you try that ?

    Thanks.