Hi.
I sample the organization (tree) code,
I want to create a (Category - Products) page.
So I did the following.
- Create Core - CategoryMaster.cs, CategoryUnit.cs file
- Aplication - CategoryUnitAppservies, ICategoryUnitAppservies And DTO
- Web - view files ...
- 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)
-
0
Hi,
This problem might be related to your entity definitions. Can you share your entity definitions ?
Thanks.
-
0
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<ArticleUnit> 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);** }
}
-
0
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.